toLocaleString() produces incorrect formatting for es-PE locale
Reported by
duca.and...@gmail.com,
Mar 2 2018
|
|||||||
Issue description
UserAgent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_13_3) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/64.0.3282.186 Safari/537.36
Steps to reproduce the problem:
1. Open Console
2. Type:
let x = 1234567.9876;
x.toLocaleString('es-CO');
x.toLocaleString('es-AR');
x.toLocaleString('es-PE');
What is the expected behavior?
All three formats should produce the same result: comma for decimal separator and dot for thousands separator.
What went wrong?
When formatting to es-PE, a dot is used for decimals separator instead of a comma, and a vice-versa for the thousands separator.
Did this work before? N/A
Chrome version: 64.0.3282.186 Channel: stable
OS Version: OS X 10.13.3
Flash Version: Shockwave Flash 28.0 r0
,
Mar 2 2018
Peru is listed among the countries with comma for decimals: https://en.wikipedia.org/wiki/Decimal_separator#Hindu%E2%80%93Arabic_numeral_system
,
Mar 2 2018
,
Mar 5 2018
Able to reproduce the issue on reported version 64.0.3282.186 and latest chrome 67.0.3361.0 using Mac 10.13.3, Ubuntu 14.04 and Windows-10, hence providing Bisect Info Bisect Info: ================ Good build: 61.0.3160.0 Bad build: 61.0.3161.0 You are probably looking for a change made after 487656 (known good), but no later than 487657 (first known bad). https://chromium.googlesource.com/chromium/src/+log/98649d0f63e6b33ac79cfad9050ef6523978ae22..01f386bfb5e4de91a53f06fdae37d62415ee874e Reviewed-on: https://chromium-review.googlesource.com/576383 @Jungshik Shin: Please confirm the issue and help in re-assigning if it is not related to your change. Thanks!
,
Mar 5 2018
This is a CLDR issue.
es-PE inherits number format symbols from es-419 (Spanish-Latin America) and es-419 has the following:
symbols{
decimal{"."}
group{","}
I'll file a CLDR ticket on the issue.
,
Mar 5 2018
See the latest CLDR: http://www.unicode.org/cldr/charts/latest/by_type/numbers.symbols.html#4ec3d1b99830ad07 es_419 uses a full stop for decimal symbol and a comma for a group separator. There's no separate es_PE for group separator and decimal point. So, it inherits es-419. There's no guarantee that wikipedia is correct. Nonetheless, I'll file a ticket in the CLDR so that it can be taken a look at.
,
Mar 5 2018
https://unicode.org/cldr/trac/changeset/3007 : 10+ years ago, es-PE was changed to explicitly use a full stop for decimal separator and a comma for thousand separator for https://unicode.org/cldr/trac/ticket/1544 . Unless there's been a change in es-PE convention over the last decade, it's WAI. If there are evidences (scanned images of printed receipts, invoices, etc) to say otherwise, please feel to reopen this.
,
Mar 6 2018
https://www.flickr.com/photos/miscositaspix/6292695883/in/album-72157627882429321/ has several typed or hand-written numbers in receipts/tickets from Peru. All of them use a full stop as a decimal separator. They're from 2010. So, Peru may have changed its convention, but not so likely.
,
Mar 6 2018
https://www.flickr.com/photos/miscositaspix/6293219630 also uses a full stop for decimal separator. "ticket from Peru" in Google image search found a lot of Peruvian tickets with a full stop for decimal separator. https://theonlyperuguide.com/peru-guide/machu-picchu/machu-picchu-entrance-tickets-types/ is the only image I found with a comma for decimal place.
,
Mar 6 2018
The problem was first raised by the intl. team at the company I work, so it might be subjective. Looking further, I found these: - https://www.ibm.com/support/knowledgecenter/en/SSS28S_8.1.0/XFDL/i_xfdl_r_formats_es_PE.html - http://www.localeplanet.com/icu/es-PE/index.html Apparently, yes: Peru uses a different notation than its neighbours. Firefox and Safari also use the same dot-notation for es_PE vs es_CO, es_AR and the rest. Comparing the above pages with their Colombian counterparts reveals the same thing: - https://www.ibm.com/support/knowledgecenter/en/SSS28S_8.1.0/XFDL/i_xfdl_r_formats_es_CO.html - http://www.localeplanet.com/icu/es-CO/index.html
,
Mar 6 2018
I was wrong again. Apparently, Peru changed their notation in 2016: http://www.sbn.gob.pe/Repositorio/resoluciones_sbn/RESOLUCION_559_0309.pdf
,
Mar 8 2018
Can someone please reconsider this ticket giving the new information I found?
,
Apr 9 2018
duca.andrei@: Thank you for finding the resolution in comment 11. I'll file a new bug against CLDR and see how it's handled there. > Firefox and Safari also use the same dot-notation for es_PE vs es_CO, es_AR and the rest. They all use ICU and CLDR. SO does Edge. So, everybody agrees on that, which is why we have to raise an issue with CLDR.
,
Apr 9 2018
https://unicode.org/cldr/trac/ticket/11048 was filed.
,
Apr 13 2018
Will not be fixed in M-67. |
|||||||
►
Sign in to add a comment |
|||||||
Comment 1 Deleted