Open Bug 1849971 Opened 11 months ago Updated 10 months ago

en-CH locale formats EUR wrong

Categories

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

Firefox 116
defect

Tracking

()

People

(Reporter: florian, Unassigned)

References

(Blocks 1 open bug)

Details

User Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:109.0) Gecko/20100101 Firefox/116.0

Steps to reproduce:

const number = 123456.789;

console.log(new Intl.NumberFormat('en-CH', { style: 'currency', currency: 'EUR', currencyDisplay: 'code' }).format(number));
console.log(new Intl.NumberFormat('en-CH', { style: 'currency', currency: 'CHF', currencyDisplay: 'code' }).format(number));

Actual results:

"EUR 123,456.79"
"CHF 123’456.79"

Expected results:

"EUR 123’456.79"
"CHF 123’456.79"

Notice the different grouping separator!

The grouping separator in all swiss locales should be (to the best of my knowledge) the high tick "’". Which also works properly in en-CH except when formatting euros, there it will use a different one.
Now I suspect that the formatting should not also depend on the currency being formatted, correct?

If this is the wrong place to report this do let me know. This affects Firefox and Chrome, whereas on Safari it seems correct.

(In reply to florian from comment #1)

If this is the wrong place to report this do let me know. This affects Firefox and Chrome, whereas on Safari it seems correct.

Thanks for the report! I've filed https://unicode-org.atlassian.net/browse/ICU-22470 with some initial investigations why the wrong currency separators are used.

Status: UNCONFIRMED → NEW
Ever confirmed: true

It seems like we can wait for the results of https://unicode-org.atlassian.net/browse/ICU-22470 before working on this, but let us know if we need to implement a workaround sooner.

Blocks: sm-runtime
Severity: -- → S4
Priority: -- → P3

Thanks André for looking into it!
We don't need this immediately, so no hurry from our side. Out of curiosity, how long does it typically take for a change at ICU to land in a stable browser version?

ICU has two releases per year, typically around March and around October. In addition to the regular updates, we also have some patches floating for our local, in-tree copy of ICU. I'm not sure a fix for ICU-22470 will make it in time for the October update, so the next possible ICU update will be next March, which should be included in either Firefox 126 or 127, which in turn will get released next year in May or June. If we can integrate the ICU patch in our local ICU copy, we can ship a fix earlier. The same applies to Chrome: They also apply regular ICU updates and also use local patches in their ICU copy.

I see, thanks for the info!
Then we will need a fix earlier, as we go live with an application that makes heavy use of this feature (finance) before June.
But we will add a workaround on our side, since not many other people seem to be affected by this :)

You need to log in before you can comment on or make changes to this bug.