Closed Bug 1013091 Opened 11 years ago Closed 10 years ago

Number.toLocaleString use space as miles separator

Categories

(Core :: JavaScript: Internationalization API, defect)

29 Branch
defect
Not set
normal

Tracking

()

RESOLVED FIXED

People

(Reporter: setoni3, Unassigned)

References

Details

User Agent: Mozilla/5.0 (Windows NT 6.1; rv:29.0) Gecko/20100101 Firefox/29.0 (Beta/Release) Build ID: 20140506152807 Steps to reproduce: I used toLocaleString() with a number variable. The locale was "es-ES". With other locales as "ca-ES" the mistake doesn't appear. Actual results: The number was 13500 and the result was "13 500". Expected results: The result must be "13.500"
Thanks for the report. This looks like bug 1010219, which was marked as duplicate of bug 999003. Waldo can you confirm this is bug 999003?
Flags: needinfo?(jwalden+bmo)
This is the same bug as bug 1010219, but actually bug 1010219 was erroneously marked as a duplicate of bug 999003. "\u00A0" is set as the group separator in intl/icu/source/data/locales/es.txt, entry "es/NumberElements/latn/symbols/group". Shell test case: --- js> (13500).toLocaleString("es-ES", {matcher: "lookup"}) "13\xA0500" js> (13500).toLocaleString("ca-ES", {matcher: "lookup"}) "13.500" --- More recent ICU versions use "." as the group separator, see http://source.icu-project.org/repos/icu/icu/trunk/source/data/locales/es.txt . Updating ICU or the CLDR files should resolve this issue.
Status: UNCONFIRMED → RESOLVED
Closed: 11 years ago
Resolution: --- → DUPLICATE
Oh sorry, mistake.
Status: RESOLVED → REOPENED
Ever confirmed: true
Resolution: DUPLICATE → ---
Status: REOPENED → UNCONFIRMED
Ever confirmed: false
Taking comment 2 as accurate, this depends on bug 992079, then. And let's confirm for good measure. :-) Although, strictly speaking, our current behavior isn't a bug by spec -- just a quality-of-implementation issue. The Internationalization API is specified in such a way that its observable behavior is very often implementation-defined, because obviously specs can't codify every single detail of every single language's locale-sensitive sorting orders, number formatting, date formatting, etc. Languages change, new languages are created, locales vary over time, etc. You can't rigorously specify all that, or rely on exact details always being the same. Still worth fixing, in any case.
Status: UNCONFIRMED → NEW
Ever confirmed: true
Flags: needinfo?(jwalden+bmo)
Component: JavaScript Engine → JavaScript: Internationalization API
OS: Windows 7 → All
Hardware: x86 → All
Depends on: 1075758
[jwalden@find-waldo-now src]$ dbg/js/src/js js> (13500).toLocaleString("es-ES", {matcher: "lookup"}) "13.500" js> (13500).toLocaleString("ca-ES", {matcher: "lookup"}) "13.500" Looks fixed to me by bug 1075758. If I'm missing some wrinkle here, please reopen -- otherwise file anything new you find in new bugs. :-)
Status: NEW → RESOLVED
Closed: 11 years ago10 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.