New issue
Advanced search Search tips
Note: Color blocks (like or ) mean that a user may not be available. Tooltip shows the reason.

Issue 737967 link

Starred by 2 users

Issue metadata

Status: Duplicate
Merged: issue v8:7472
Owner:
Last visit > 30 days ago
Closed: Jun 2018
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: Linux , Windows , Mac
Pri: 2
Type: Bug



Sign in to add a comment

Broken Intl.NumberFormat currency formatting with default 'maximumFractionDigits' option.

Reported by marcin.k...@gmail.com, Jun 29 2017

Issue description

UserAgent: 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.
 
intl-chrome-bug.js
9.5 KB View Download
Labels: M-61 OS-Linux OS-Mac
Status: Untriaged (was: Unconfirmed)
Tested this issue using latest stable #59.0.3071.115 on Win 10, Mac 10.12.4 and Linux Ubuntu 14.04 and able to reproduce the issue.

This issue seems to be a Non-Regression issue as same behavior is seen since M50. Untriaged the issue to get more inputs from dev.

Note: Unable to check the issue <M50 builds as above test case not working as expected in older builds.

Same behavior is seen in M61 as well.

Please find the screenshot.

Thanks!!
Screenshot (4).png
261 KB View Download
Components: -Blink>JavaScript Blink>JavaScript>Internationalization
Status: Available (was: Untriaged)
Owner: littledan@chromium.org
Status: Assigned (was: Available)
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?
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. 


Cc: js...@chromium.org
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?
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.
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.

Comment 8 by js...@chromium.org, Jun 22 2018

Mergedinto: v8:7472
Status: Duplicate (was: Assigned)

Sign in to add a comment