number.toLocaleString returns incorrect formatting for en-ID
Categories
(Core :: JavaScript: Internationalization API, defect, P3)
Tracking
()
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
Comment 1•1 year ago
|
||
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).
Comment 2•1 year ago
|
||
(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"
| Reporter | ||
Comment 3•1 year ago
|
||
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
Updated•1 year ago
|
Comment 4•1 year ago
|
||
Fixed through the update to ICU 76 (bug 1927706).
Description
•