I have stumbled upon an inconsistency in number formatting for the "km-KH" locale between Firefox, Chrome, and the ASP.NET MVC Core web application.
In Chrome and the ASP.NET MVC Core web application, numbers use the dot for decimal separator and comma for thousands separator. But in Firefox, it is the other way around, which obviously causes a disrepancy.
If one were to paste the following snippet in the browser console:
(1234.56).toLocaleString('km-KH')
// or
new Intl.NumberFormat('km-KH').format(1234.56)
Chrome would render:
"1,234.56"
Firefox would render:
"1.234,56"
My primary question is simple: how to fix this inconsistency?
As far as I can tell, Firefox is misbehaving, while Chrome and ASP.NET MVC Core are working as intended.
Fun fact: there is also an inconsistency in the CLDR definition for the "km" number formatting: https://github.com/unicode-cldr/cldr-numbers-full/blob/master/main/km/numbers.json
Defined symbols are: comma as the decimal separator and dot as the grouping separator
"symbols-numberSystem-latn": {
"decimal": ",",
"group": ".",
// ...
}
But when they specify the decimal format, they use it the other way around:
"decimalFormats-numberSystem-latn": {
"standard": "#,##0.###",
// ...
}
Is this an actual bug in the localization definition?