ecma402 icon indicating copy to clipboard operation
ecma402 copied to clipboard

Add ability to use the European number format without specifying a country

Open Kembreg1405 opened this issue 8 months ago • 6 comments

Yes, I know, probably not the right place for this. Still.

toLocaleString

has a list of dozens and dozens of country settings. But no "eu". Hmmm.

Sometimes it's convenient to just tell js "Use the European number format" without having to specify a country.

I suggest "eu" be added as a setting for 'toLocaleString'

Kembreg1405 avatar Apr 18 '25 17:04 Kembreg1405

Thanks for filing the issue. I've tagged this as "User Preferences" to track this as part of ongoing efforts to improve localization quality on the Web.

By the way, locale "eu" is Basque.

sffc avatar Apr 18 '25 18:04 sffc

Would en-150 not be the correct tag for this in BCP47? (I doubt it's currently supported by browsers in the way you'd expect though.)

ptomato avatar Apr 21 '25 17:04 ptomato

It looks like the CLDR semantics of en-150 are explicitly not to change the decimal separator: https://github.com/unicode-org/cldr/blob/main/common/main/en_150.xml

hsivonen avatar Apr 22 '25 05:04 hsivonen

In general, it seems that CLDR is rather buggy in this area: The results for attaching a continental European region code to en are incoherent for currency vs. non-currency formatting, which seems bad regardless of what one thinks the right behavior is for attaching a continental European region code to en.

Furthermore, I think the premise of this request is faulty: There isn't a country-independent European number format. Right now in CLDR FR and DE have a different thousand separator.

hsivonen avatar Apr 22 '25 05:04 hsivonen

In general, it seems that CLDR is rather buggy in this area: The results for attaching a continental European region code to en are incoherent for currency vs. non-currency formatting, which seems bad regardless of what one thinks the right behavior is for attaching a continental European region code to en.

There are also issues when formatting currencies in locales inheriting from en-150:

  • https://bugzilla.mozilla.org/show_bug.cgi?id=1849971
  • https://unicode-org.atlassian.net/browse/CLDR-17074
  • https://unicode-org.atlassian.net/browse/CLDR-17965

anba avatar Apr 22 '25 07:04 anba

(I was kind of hoping that en-150 would signify Euro-English, but not that seriously 😄)

ptomato avatar Apr 22 '25 15:04 ptomato