Closed Bug 1909112 Opened 1 year ago Closed 1 year ago

Using nb-NO locale in Intl.Numberformat returns wrong result when formatting currency

Categories

(Core :: JavaScript: Internationalization API, defect, P3)

Firefox 128
defect

Tracking

()

RESOLVED FIXED
134 Branch
Tracking Status
firefox134 --- fixed

People

(Reporter: nutgaard, Unassigned)

References

(Blocks 1 open bug)

Details

Attachments

(1 file)

Attached image intl bug ff.png

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).

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.

Component: Untriaged → JavaScript: Internationalization API
Product: Firefox → Core

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

(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 no between 43 and 44, but not for nb, 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.

Blocks: sm-icu
Severity: -- → S4
Depends on: 1859752
Priority: -- → P3
No longer depends on: 1859752
Depends on: 1927706

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" 
Status: UNCONFIRMED → RESOLVED
Closed: 1 year ago
Resolution: --- → FIXED
Target Milestone: --- → 134 Branch
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: