Premium support for our pure JavaScript UI components


Post by TeemuL »

Hello,

When editing Grids number-type column's cell, there is inconsistency in the way I can input decimal-numbers, based on the browser I use.

Firefox:

  • Comma (,) can be used as decimal delimiter
  • Dot (.) can be used as decimal delimiter

Chrome

  • Comma (,) can't be used as decimal delimiter (I would want to, but it's used as thousand separator it seems)
  • Dot (.) can be used as decimal delimiter

I am not sure is this a browser/OS setting related thing. So if you have any clue how this should work or if there is a configuration in Grid for this, please let me know :)

This can be tested on https://www.bryntum.com/examples/grid/basic/, see steps on attachment picture.

delimiter_inconsistency.jpg
delimiter_inconsistency.jpg (54.22 KiB) Viewed 380 times

Post by tasnim »

Hi,
I'm not able to reproduce it. What OS and browser version are you using?


Post by TeemuL »

Chrome 106.0.5249.119 (Official Build) (64-bit)
Firefox 106.0.1 (64-bit)
Windows 10 Pro Version 21H2 OS build 19044.2006


Post by TeemuL »

Dont know if these are related but:

Windows display language: English (Finland)
Regional format: English (Finland)
Keyboard settings: English (United States), Finnish keyboard


Post by alex.l »

Hi TeemuL,

Thank you for the report. I've reproduced that problem. Here is a ticket to track the status https://github.com/bryntum/support/issues/5472

All the best,
Alex


Post by TeemuL »

Allright, so it looks like the Chrome works like it should and not the Firefox.

My problem is, that our clients are mostly power users, who use numpad to enter numeric values. In numpad, the decimal separator is comma, so it's easily reached while editing grid cells and typing the numbers fast from numpad.

According to wikipedia (https://en.wikipedia.org/wiki/Decimal_separator):

Both a comma and a period (or full-stop) are generally accepted decimal separators for international use.

decimal_separator_usage.jpg
decimal_separator_usage.jpg (196.38 KiB) Viewed 358 times

As for thousand separator, in finnish culture we don't use comma as a thousand separator, rather just empty space. Picture from the wiki:

thousand_separator.png
thousand_separator.png (80.71 KiB) Viewed 358 times

Summary: there is 2 things, that would need to be localized according to finnish culture standards. Thousand separator as space and comma used as decimal delimiter when inputting numbers. Decimal delimiter input is the most important thing.

Questions:

  • Would it be possible to set the thousand separator and decimal delimiter as comma in inputs as a localizable thing in the locale-files? Or atleast the decimal delimiter. Could you develop such feature?
  • Or should I implement a custom column to be used in Grid and do parsing of user input and rendering myself?

Post by alex.l »

We already supported number format localization.
If you check this example https://bryntum.com/examples/grid/localization/ , change language to, let's say, Deutsch, and try to write a big number/decimal into Age field, you will see it's working well.
All you need is to use proper localization code in locale property of your localization file.
See examples in the demo I mentioned above.
Here is locale codes https://www.iana.org/assignments/language-subtag-registry/language-subtag-registry

We have a ticket about runtime localization change, but besides that all working well https://github.com/bryntum/support/issues/5437

All the best,
Alex


Post by TeemuL »

Allright, thanks for this info! :)


Post by joel moisio »

Hi

Not sure if our problem has been understood correctly.

It seems that on the grid number column the editors format comes from browser language settings rather than grid locale settings.

Problem is easily reproduced on your test page:
https://www.bryntum.com/products/grid/examples/localization/

Before below sequence make sure that your browser language is set to English (United States) (I'm using chrome in this test).

  1. Select Svenska as the locale (i assume your example page sets the grid locale correctly via this choice as everything else gets translated).
  2. Edit Age (Ålder) cell on any of the rows
  3. Type 23.5 (with a dot)
  4. Complete the edit
  5. The rendered values decimals seem to be correctly rendered with a comma (even though we used dot when inputting the value)
  6. Edit the same column again on any row
  7. Type 23,5 (with a comma)
  8. The value is set to 235 even though the grid locale is set to Swedish, that uses comma as a decimal separator

Post by alex.l »

Hi,

Thank you for steps to reproduce. I've opened a ticket for this problem here https://github.com/bryntum/support/issues/6948

All the best,
Alex


Post Reply