ecma402
ecma402 copied to clipboard
Intl.NumberFormat() - narrowSymbol issue in en-CA culture, USD currency
Hello,
as per "narrowSymbol" Use a narrow format symbol ("$100" rather than "US$100").
Issue: When we use en-CA culture, USD currency the result is not narrow symbol $100, but US$100 (which I would expect if I used "symbol".
Test code:
const number = 100;
console.log('USD, en-CA: ',
new Intl.NumberFormat('en-CA', {currencySign: "standard", currencyDisplay: 'narrowSymbol', style: 'currency', currency: 'USD' }).format(
number,
),
);
console.log('USD, en-US: ',
new Intl.NumberFormat('en-US', {currencySign: "standard", currencyDisplay: 'narrowSymbol', style: 'currency', currency: 'USD' }).format(
number,
),
);
Code output: "USD, en-CA: " "US$100.00" "USD, en-US: " "$100.00"
PS. it would be good to check also rest of the currencies.
I can reproduce the stated behavior. It appears the change from "$" to "US$" in en-CA appeared in CLDR 42:
https://www.unicode.org/cldr/charts/42/delta/en.html#Northern%20America:%20United%20States
CC @ptomato @dminor who speak en-CA
I filed an upstream issue in CLDR. If it is a bug, it should be fixed in CLDR, not ECMA-402.
https://unicode-org.atlassian.net/browse/CLDR-17372
As an en-CA speaker I don't have a particular opinion on this — $100 by itself when referring to USD 100 is misleading and I wouldn't use it, but if it was clear from context, I think it'd be OK. Maybe a good place to check would be the style guide of a Canadian newspaper, such as the Globe and Mail.
Yeah Canadian refers to CAD as just $, so USD in en-CA should be US$.
To be sure, this report is about the "narrowSymbol" option which is specifically documented as being useful only when there is enough context, such as prices down a column with a heading "USD".
Exactly, we have currency specified in the header of the page. In the table we use only symbols, but for better visibility we are using group separators for the thousands and also decimal separator as per the culture of user.
Upstream fix to land in CLDR 45: https://github.com/unicode-org/cldr/pull/3566