Closed Bug 1919905 Opened 1 year ago Closed 1 year ago

number.toLocaleString returns incorrect formatting for en-ID

Categories

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

defect

Tracking

()

RESOLVED FIXED

People

(Reporter: jessneurismfarmer, Unassigned)

References

(Blocks 1 open bug)

Details

Steps to reproduce:

let num = 123456.78
console.log(num.toLocaleString('en-ID'));

Actual results:

123,456.78

Expected results:

123.456,78

The latest CLDR (v45) has

"symbols-numberSystem-latn": {
  "decimal": ",",
  "group": ".",

But also

"decimalFormats-numberSystem-latn": {
  "standard": "#,##0.###",

Which seems an error.

With that said, Chrome returns 123.456,78, but I don't see this data changing between v45 and v43 (which AFAIK is the one use by Firefox).

Component: Untriaged → JavaScript: Internationalization API
Product: Firefox → Core
Summary: number.tolocalestring returning wrong format → number.toLocaleString returns incorrect formatting for en-ID

(In reply to Francesco Lodolo [:flod] from comment #1)

With that said, Chrome returns 123.456,78, but I don't see this data changing between v45 and v43 (which AFAIK is the one use by Firefox).

Yes, we're still using CLDR 43 (because of various ICU issues). Per https://cldr.unicode.org/index/downloads/cldr-44, en-ID was introduced in CLDR 44, which explains why it's currently unsupported:

> new Intl.NumberFormat("en-ID").resolvedOptions().locale
"en"

Interestingly, providing a fall back language also does not work.

console.log(1234567.89.toLocaleString(["en-id", "id-id"]));
Actual results:
123,456.78

Expected results:
123.456,78

Blocks: sm-icu
Severity: -- → S3
Priority: -- → P3

Fixed through the update to ICU 76 (bug 1927706).

Status: UNCONFIRMED → RESOLVED
Closed: 1 year ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.