| Summary: | Intl NumberFormat style currency incorrect format for 'es-CA' CAD | ||||||
|---|---|---|---|---|---|---|---|
| Product: | WebKit | Reporter: | Illia Bilichenko <tglm22> | ||||
| Component: | WebCore JavaScript | Assignee: | Nobody <webkit-unassigned> | ||||
| Status: | RESOLVED WONTFIX | ||||||
| Severity: | Normal | CC: | webkit-bug-importer, ysuzuki, zmicerboksha | ||||
| Priority: | P2 | Keywords: | InRadar | ||||
| Version: | WebKit Nightly Build | ||||||
| Hardware: | All | ||||||
| OS: | Unspecified | ||||||
| Attachments: |
|
||||||
I have a similar situation with
Intl.NumberFormat('fr-US', { style: 'currency', currency: 'USD' }).format(99999999)
Chrome (84.0.4147.89) and Firefox (78.0.2) --> "99 999 999,00 $US"
Safari (Version 13.1.2 (15609.3.5.1.3) --> "99999999,00 $US"
Created attachment 405267 [details]
Intl.NumberFormat problem
But something interesting happens when I'm trying to select or copy/paste value.
Thanks for your reporting! (In reply to Illia Bilichenko from comment #0) > Facing different results of currency format for locale 'es-CA' and CAD > currency. > > In Chrome(84.0.4147.89) and Firefox(78.0.2): > Intl.NumberFormat("es-CA", { style: 'currency', currency: "CAD" > }).format(100.0) --> "100,00 CA$" > > In Safari(14.0) & Webkit build(r264591): > Intl.NumberFormat("es-CA", { style: 'currency', currency: "CAD" > }).format(100.0) --> "$110.00" > > Unfortunately, I can't find any specification how it showed be formated. Is > it expected behavior? Yes, both are right and expected behaviors because CAD's code is $. (In reply to Dmitry Boksha from comment #3) > Created attachment 405267 [details] > Intl.NumberFormat problem > > But something interesting happens when I'm trying to select or copy/paste > value. Strictly speaking, this is not WebKit's issue. They are bugs in ICU (https://github.com/unicode-org/icu). Firefox and Chrome are bundling the latest ICU. Safari is using ICU which is installed in the system (macOS etc.). If you upgrade the system, you will see the updated behavior in Safari. I've tested these things with ToT JavaScriptCore with Big Sur beta 3 and ensured that they are now fixed because ICU is updated by the system update. |
Facing different results of currency format for locale 'es-CA' and CAD currency. In Chrome(84.0.4147.89) and Firefox(78.0.2): Intl.NumberFormat("es-CA", { style: 'currency', currency: "CAD" }).format(100.0) --> "100,00 CA$" In Safari(14.0) & Webkit build(r264591): Intl.NumberFormat("es-CA", { style: 'currency', currency: "CAD" }).format(100.0) --> "$110.00" Unfortunately, I can't find any specification how it showed be formated. Is it expected behavior?