Locale Settings and Decimal Separator

With the 2022.XX version the whole way to manage the standard settings has changed. I had to put my hand to all the code because with the arithmetic calculations of the previous version now it is not found.
I set the Italian language it-IT the file I got from the forum (thanks lamorte). My need is to have the period instead of the comma so that it does not have to change all the times for the operations of change from, to. for mathematical operations. ex: 1250.23. I know that to override the “intl” setting of the locale you can act on the locale. these are my local settings.

{
  "id": "it-IT",
  "desc": "Italian (Italy)",
  "number": "#. ##",
  "currency": "0.00¤",
  "currency_code": "EUR",
  "currency_symbol": "€",
  "percent": "#, ## 0%",
  "decimal_separator": ",",
  "grouping_separator": ".",
  "numbering_system": null,
  "date": "dd / MM / yy",
  "time": "HH: mm",
  "time_zone": null
}

Now I display the fields (view tag) “currency” as X, XX €.
Problems:

  1. The custom fields are NOT affected by the patterns of the locale
  2. the custom fields are NOT influenced by the view tag settings paterns
  3. even if I change the value “decimal_separator”: “,”, in “decimal_separator”: “.”, Or “decimal_separator”: “-”, nothing changes, wherever I find the “,” either if I operate as a system and regenerate the files, either if I directly edit the it-IT.json file from the “prj \ locale” folder
  4. When I type ex: 50.80 and add the line it stores 50,00
  5. When I type ex: 50,80 and add to the line it stores 50,80
  6. In the database I store 50.80I checked with the English language. If I set the English language, the decimals after the point remain.
    it-IT 10.25 → 10.00
    it-IT 10,25 → 10,25
    en-US 10.25 → 10.25
    en-US 10,25 → 10.00
    Furthermore, when you access the local setting, you have to click on cancel to “deselect” the previous choice, it would be better to have another button to confirm the change, not the window one.Thanks for your help
  1. If you use “grouping_separator”: “.” and “decimal_separator”: “,”, then you enter “50.80”, the format is wrong, the value cannot be parsed to number after the “.”, so 50 is returned. When you enter “50,80”, the format is correct, the value can be parsed to the end, so 50.80 is returned.
  2. You should ALWAYS input values using the matching format you specified in the locale settings, otherwise the input value cannot be parsed correctly according to the locale settings. So only the follows are correct:
    it-IT 10,25 → 10,25
    en-US 10.25 → 10.25

Thank you very muchmistakenly I hadn’t thought about grouping_separator so it can’t distinguish from units to decimals.
I would like to use the Italian language for sure, but I would like to avoid having to change every time I have to calculate the, with the. in js. So I just thought about changing the standard format from 10.10 to 10.10 for working with js and calculations. Another solution is that an aid is always welcome.

If you want to implement Javascript calculation, I suggest you to always use , as grouping_separator and . as decimal_separator.

GT73 wrote:

I would like to use the Italian language for sure, but I would like to avoid having to change every time I have to calculate the, with the. in js.

You have to convert the input values from string to number first so you can calculate the value as numbers. You may use .toNumber(), see jQuery .fields() plugin or use ew.parseNumber().