Broken Intl.NumberFormat currency formatting with default 'maximumFractionDigits' option.
Reported by
marcin.k...@gmail.com,
Jun 29 2017
|
|||||
Issue descriptionUserAgent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:54.0) Gecko/20100101 Firefox/54.0 Steps to reproduce the problem: 1. Execute the script from attached file. What is the expected behavior? I'd expect that value of 'maximumFractionDigits' for each currency code will be equal to the value of `Minor Unit` column from ISO 4217 currency code list (https://www.currency-iso.org/en/home/tables/table-a1.html). What went wrong? Probably there're discrepancies between Chrome's locale and collation options and ISO currency code list for following currency codes: CurrencyCode: AFN Chrome: 0 ISO: 2 CurrencyCode: ALL Chrome: 0 ISO: 2 CurrencyCode: AMD Chrome: 0 ISO: 2 CurrencyCode: COP Chrome: 0 ISO: 2 CurrencyCode: GYD Chrome: 0 ISO: 2 CurrencyCode: IDR Chrome: 0 ISO: 2 CurrencyCode: IRR Chrome: 0 ISO: 2 CurrencyCode: IQD Chrome: 0 ISO: 3 CurrencyCode: KPW Chrome: 0 ISO: 2 CurrencyCode: LAK Chrome: 0 ISO: 2 CurrencyCode: LBP Chrome: 0 ISO: 2 CurrencyCode: MGA Chrome: 0 ISO: 2 CurrencyCode: MRO Chrome: 0 ISO: 2 CurrencyCode: MUR Chrome: 0 ISO: 2 CurrencyCode: MNT Chrome: 0 ISO: 2 CurrencyCode: MMK Chrome: 0 ISO: 2 CurrencyCode: PKR Chrome: 0 ISO: 2 CurrencyCode: STD Chrome: 0 ISO: 2 CurrencyCode: RSD Chrome: 0 ISO: 2 CurrencyCode: SLL Chrome: 0 ISO: 2 CurrencyCode: SOS Chrome: 0 ISO: 2 CurrencyCode: SYP Chrome: 0 ISO: 2 CurrencyCode: TZS Chrome: 0 ISO: 2 CurrencyCode: UZS Chrome: 0 ISO: 2 CurrencyCode: YER Chrome: 0 ISO: 2 Did this work before? No Does this work in other browsers? Yes Chrome version: 59.0.3071.115 (Oficjalna wersja) (64-bitowa) Channel: stable OS Version: 10.0 Flash Version: I've checked this also on Firefox, Safari and Edge. First two doesn't show any discrepancies, on Edge "N.A." values from ISO list are converted to 0. I'm not sure if there's any paragraph in ECMA Script API standard telling that these values should be equal to ISO currency code list values but it seems that other browsers aligned.
,
Jul 10 2017
,
Jul 12 2017
This is a known, deliberate spec violation. Although ECMA 402 requires ISO 4217, it seems like CLDR has better data. I'm proposing a change upstream here: https://github.com/tc39/ecma402/issues/134 . I'm wondering, what led to this bug report? Depending what it is, maybe I shouldn't be pursuing this specification change: - Are you interested in this out of abstract specification compliance? - Did you notice the bothersome mismatch with Safari and Firefox? - Do the ISO 4217 numbers seem more appropriate semantically for your application?
,
Jul 14 2017
I wasn't aware that there's an open discussion about that and assumed that ISO values defined by specification. Beside browsers differences this bug report was driven by discrepancies with our application settings which are closer to the ISO values. Anyway, currently we're overriding those Intl settings for all browsers to get consistent output across web clients. So if specification will allow for implementation-specific values that's probably the only way to achieve that goal.
,
Jul 14 2017
Just curious, why does your application want the IS0 4217 values? Maybe CLDR should represent these if it's generally useful. Or do you need values that are distinct from either one?
,
Jul 21 2017
Good question. I've got those values from our BAs and formatting discrepancies were noticed in chrome only. Need to check if they are aware of these competing specifications (ISO & CLDR) - probably not and that issue was raised just because they noticed different outputs.
,
Aug 15 2017
OK, sounds like mismatch is the real issue here, not that the ISO values are better. I think I'll keep pushing for the better data, in that case. If you find any information to the contrary, I'd be interested to hear it.
,
Jun 22 2018
|
|||||
►
Sign in to add a comment |
|||||
Comment 1 by sandeepkumars@chromium.org
, Jul 6 2017Status: Untriaged (was: Unconfirmed)
261 KB
261 KB View Download