Number..toLocaleString(locale) does not work correctly with certain locales
Categories
(Core :: JavaScript: Internationalization API, defect)
Tracking
()
People
(Reporter: emil, Unassigned)
References
Details
User Agent: Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Ubuntu Chromium/71.0.3578.80 Chrome/71.0.3578.80 Safari/537.36
Steps to reproduce:
Consider the following JS expression: (123.456).toLocaleString("no"). It returns a string without comma as the decimal separator. Norwegian uses the comma as the decimal separator.
(123.456).toLocaleString("nb") and (123.456).toLocaleString("nn") both work however, which is correct. Both nb and nn has the macrolanguage no according to the language subtag registry https://www.iana.org/assignments/language-subtag-registry/language-subtag-registry.
Expected results:
123,456
Comment 1•6 years ago
|
||
Hi, Im not entirely sure this is the correct component, but it seems like a good place to start, Please change the component to a more suitable one if this is not the correct one.
Updated•6 years ago
|
Comment 2•6 years ago
•
|
||
That's not what I see in Firefox console. On which version are you trying?
(123.456).toLocaleString("no")
"123,456"
(123.456).toLocaleString("nb")
"123,456"
(123.456).toLocaleString("nn")
"123,456"
I also assume you meant thousand separator in comment 1 (not decimal)?
Comment 3•6 years ago
|
||
Side note: this data is not Mozilla's, it comes from CLDR (Unicode). If there are issues, they likely need to be reported upstream
https://github.com/unicode-cldr/cldr-numbers-full/tree/master/main
Updated•6 years ago
|
Comment 4•6 years ago
|
||
The language identifier no
is currently not supported.
js> Intl.NumberFormat.supportedLocalesOf(["nb", "nn", "no"])
["nb", "nn"]
But bug 1522070 should fix this issue by mapping no
to nb
per CLDR.
Comment 5•6 years ago
|
||
The priority flag is not set for this bug.
:Waldo, could you have a look please?
For more information, please visit auto_nag documentation.
Comment 6•6 years ago
|
||
This is now fixed in Nightly. Dup'ing to bug 1522070 (see comment #4).
Updated•5 years ago
|
Description
•