Intl.NumberFormat not recognising en-AU
Reported by
jjv...@gmail.com,
Oct 3
|
|||||
Issue descriptionUserAgent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/69.0.3497.100 Safari/537.36 Steps to reproduce the problem: 1. Create instance of the Intl.NumberFormat using the locale 'en-AU'. Ensure currency is specified and set the currency code to 'GBP'. 2 Use the created instance to format a number to a string See Example https://jsbin.com/miliduvimo/edit?html,js,console What is the expected behavior? A number like 1234.56 should convert to a string like '£1,234.56' What went wrong? The resulting string is 'GBP 1,234.56' Did this work before? N/A Chrome version: 69.0.3497.100 Channel: stable OS Version: 10.0 Flash Version: Works as expected on current Firefox / Edge. Setting the locale to en-AUS also fixes the problem but that's not the correct locale for Australian English (it should be en-AU)
,
Oct 3
Frank, is this an ICU bug?
,
Oct 3
,
Oct 5
Able to reproduce the issue on chrome reported version# 69.0.3497.100 using Windows-10, Mac 10.12.6 and Ubuntu 14.04 with URL mentioned in comment# 0. As this issue is seen from M-60(60.0.3112.0), hence considering this issue as Non-Regression and marking it as Untriaged. Thanks!
,
Oct 5
++ Able to reproduce the issue on chrome reported version# 69.0.3497.100 and on latest chrome# 71.0.3570.0.
,
Oct 8
d8> let auFormatter = new Intl.NumberFormat('en-AU', { style: 'currency', currency: 'GBP' });
let amount = 1234.56;
undefined
d8> auFormatter.format(amount)
"GBP 1,234.56"
d8> let enFormatter = new Intl.NumberFormat('en', { style: 'currency', currency: 'GBP' });
undefined
d8> enFormatter.format(amount)
"£1,234.56"
d8> let nzFormatter = new Intl.NumberFormat('en-NZ', { style: 'currency', currency: 'GBP' });
undefined
d8> nzFormatter.format(amount)
"£1,234.56"
d8> let enusFormatter = new Intl.NumberFormat('en-US', { style: 'currency', currency: 'GBP' });
undefined
d8> enusFormatter.format(amount)
"£1,234.56"
d8> let auEuroFormatter = new Intl.NumberFormat('en-AU', { style: 'currency', currency: 'EUR' });
undefined
d8> auEuroFormatter.format(amount)
"EUR 1,234.56"
I chatted w/ Markus. This is by design. GBP is not a local currency in AU and £ is used by multiple foreign currency. In third_party/cldr/common/main/en_AU.xml
the author of the locale data mark it as
"<symbol draft="contributed">GBP</symbol>
<currency type="GBP">
<symbol draft="contributed">GBP</symbol>
</currency>
also see
<currency type="EUR">
<displayName count="one">euro</displayName>
<displayName count="other">euro</displayName>
<symbol draft="contributed">EUR</symbol>
</currency>
and when it get into ICU
src/third_party/icu/source/data/curr/en_AU.txt
it turn into
EUR{
"EUR",
"Euro",
}
GBP{
"GBP",
"British Pound",
}
so GBP and EUR is used for en-AU locale. In the other hand, author of en-US has no such lines.
,
Oct 8
,
Oct 8
mark it as work as intended
,
Oct 8
If the reporter does not agree, please file bug against CLDR instead in http://cldr.unicode.org/index/bug-reports for the file cldr/common/main/en_AU.xml
,
Oct 8
Thanks - I've filed a bug with CLDR at https://unicode.org/cldr/trac/ticket/11471 |
|||||
►
Sign in to add a comment |
|||||
Comment 1 by dtapu...@chromium.org
, Oct 3