New issue
Advanced search Search tips

Issue 818169 link

Starred by 1 user

Issue metadata

Status: ExternalDependency
Owner:
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: Linux , Android , Windows , Chrome , Mac
Pri: 2
Type: Bug-Regression



Sign in to add a comment

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
 
Screenshot 2018-03-02 14.36.40.png
14.8 KB View Download

Comment 1 Deleted

Peru is listed among the countries with comma for decimals: https://en.wikipedia.org/wiki/Decimal_separator#Hindu%E2%80%93Arabic_numeral_system
Components: -Blink Blink>JavaScript>Internationalization
Labels: -Type-Bug -Pri-2 hasbisect-per-revision Target-67 RegressedIn-61 Triaged-ET Target-66 Target-64 M-67 Target-65 FoundIn-66 FoundIn-67 FoundIn-64 FoundIn-65 Needs-Triage-M64 OS-Linux OS-Windows Pri-1 Type-Bug-Regression
Owner: js...@chromium.org
Status: Assigned (was: Unconfirmed)
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!

Comment 5 by js...@chromium.org, Mar 5 2018

Labels: -Pri-1 -Target-64 -Target-65 OS-Android OS-Chrome Pri-2
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. 

Comment 6 by js...@chromium.org, 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. 

Comment 7 by js...@chromium.org, Mar 5 2018

Status: WontFix (was: Assigned)
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. 

Comment 8 by js...@chromium.org, 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. 



Comment 9 by js...@chromium.org, 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. 
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
I was wrong again. Apparently, Peru changed their notation in 2016: http://www.sbn.gob.pe/Repositorio/resoluciones_sbn/RESOLUCION_559_0309.pdf
Can someone please reconsider this ticket giving the new information I found?
Status: ExternalDependency (was: WontFix)
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. 

Comment 15 by js...@chromium.org, Apr 13 2018

Labels: -M-67 -Needs-Triage-M64
Will not be fixed in M-67. 

Sign in to add a comment