- π©π°Denmark ressa Copenhagen
This is a great idea. I created a duplicate issue the other day, which I will close. ( β¨ Allow translating Thousand marker and Decimal marker under Display Active )
- π©π°Denmark ressa Copenhagen
Updating Issue Summary based on great discussion in β¨ META: Provide locale (regional) formats framework for automated translation of non textual data Active .
- π©πͺGermany Anybody Porta Westfalica
For the number formats https://www.drupal.org/project/advanced_number_format β might be a good starting point if we want to start in contrib.
- π©π°Denmark ressa Copenhagen
Thanks for the suggestion @anybody! I have added it in the Issue Summary to highlight your great initiative.
Though that also seems to include number manipulation (such as rounding), which could add complexity, whereas the scope here is purely presentation, and visualizing numbers by defining Thousand and Decimal separators ... But if the added features are not blockers, it's no problem. Also, I do see the benefit of thinking more holistically about it, though that may also cause an issue to balloon, and get bikeshedded. It's a balance :)
- π¨π¦Canada xmacinfo Canada
Yes, indeed, we only need to touch presentation.
In the database (or result of calculation, eg. sales tax) me may have a value of β1.131416β. When presenting that value, the display would be transformed to:
Decimals and thousands separators:
Typical English localization:
1.131,416Typical French localization:
1,131 416Typical English localization:
10 123.13Typical French localization:
10 123,13Currency sign formatter:
Typical English localization:
$10 123.13Typical French localization:
10 123,13 $etc.
For measurements units, the database must also store the default measurement unit, most probably loaded from a config. So, if the config for the site is set to imperial units, we can still use a single value in the database and load the unit config at display time.
Example of a Canadian number with a measurement unit coming from default:
Typical Canadian English localization:
1.5LTypical French localization:
1,5 LNot sure if core should offers tool to convert unit of measures or use a vendor.
But the UI, if enabled, should let users convert unit of measures easily.