Using nb-NO locale in Intl.Numberformat returns wrong result when formatting currency
Categories
(Core :: JavaScript: Internationalization API, defect, P3)
Tracking
()
| Tracking | Status | |
|---|---|---|
| firefox134 | --- | fixed |
People
(Reporter: nutgaard, Unassigned)
References
(Blocks 1 open bug)
Details
Attachments
(1 file)
|
67.48 KB,
image/png
|
Details |
Steps to reproduce:
Downloaded newest firefox (128), and ran the following in console;
new Intl.NumberFormat('nb-NO', { style: 'currency', currency: 'NOK' }).format(123);
Actual results:
It returns "kr 123,00"
Expected results:
It should return "123,00 kr" (similar to NodeJS 22 and Chrome).
Comment 1•1 year ago
|
||
The Bugbug bot thinks this bug should belong to the 'Core::JavaScript: Internationalization API' component, and is moving the bug to that component. Please correct in case you think the bot is wrong.
Comment 2•1 year ago
|
||
As far as I can tell, Firefox currently uses ICU 73 (which maps to CLDR 43).
I can see a change in CLDR tables for no between 43 and 44, but not for nb, not sure if there's a fallback between the two.
https://unicode.org/cldr/charts/43/by_type/numbers.number_formatting_patterns.html
¤ #,##0.00;¤ -#,##0.00
https://unicode.org/cldr/charts/44/by_type/numbers.number_formatting_patterns.html
#,##0.00 ¤;-#,##0.00 ¤
CLDR 45 seems to have the currency symbol after the numbers
https://github.com/unicode-org/cldr-json/blob/main/cldr-json/cldr-numbers-full/main/nb/numbers.json#L110
Comment 3•1 year ago
|
||
(In reply to Francesco Lodolo [:flod] (OOO July 13–21) from comment #2)
As far as I can tell, Firefox currently uses ICU 73 (which maps to CLDR 43).
Updating to a more recent ICU is currently blocked by https://unicode-org.atlassian.net/browse/ICU-22729.
I can see a change in CLDR tables for
nobetween 43 and 44, but not fornb, not sure if there's a fallback between the two.
nb's parent locale is no -> https://github.com/unicode-org/cldr/blob/6511e3df383c00c155d8b437780cb1a174a8f4b0/common/supplemental/supplementalData.xml#L5443.
Updated•1 year ago
|
Comment 4•1 year ago
|
||
This is fixed by the landing of bug 1927706. After updating to the latest Nightly, I see the expected result here:
⟫ new Intl.NumberFormat('nb-NO', { style: 'currency', currency: 'NOK' }).format(123);
← "123,00 kr"
Updated•1 year ago
|
Description
•