-
Notifications
You must be signed in to change notification settings - Fork 29.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Number.toLocaleString output is inconsistent between minor versions. #21053
Comments
Failed to reproduce on Ubuntu 16.04:
|
Please show |
v10.2.1
v10.3.0
|
Interesting, same ICU version and build but different output. Any idea @nodejs/intl? |
Cannot reproduce with Windows builds: > node.10.2.1.exe -e "console.log((1999.99).toLocaleString('us', {style: 'currency', currency: 'USD'}))"
US$ 1,999.99
> node.10.3.0.exe -e "console.log((1999.99).toLocaleString('us', {style: 'currency', currency: 'USD'}))"
US$ 1,999.99 |
can repro on mac
|
i would guess this is related to #20826 /cc @TimothyGu |
Yes… this was intended to be a fix of a bug that presented itself somewhere between v7.9.0 and v8.4.0 (#15223). I personally don’t believe the bug fix was a breaking change that warrants semver-major, but I do realize that it has the potential to break some test suites, so apologies about that. I don’t think there is much we can do right now though. After all a revert would just make the problem worse (another such change in the v10.x branch). |
Closing based on #21053 (comment). |
test suites should not expect specific 'golden' results for locale data. |
@srl295 Maybe, but you'd expect the same result on the same locale between node versions, right? We noticed the issue upgrading to node 10+ so we ended up removing the usage of locale, unfortunately. |
I just started testing Node 10 for planned migration from Node 8. Noticed that Date.toLocaleString("iso") now behaves differently. Under Node 8 I would get "2019-03-12 12:34:56" but under Node 10+ I am getting "03/12/2019 12:34:56 PM". Funny thing is I am trying to find the old reference to "iso" as a valid locale and I am having no luck. I suspect it may have been expunged. However, toLocaleString() does not throw an error with it like it does for other invalid locales. |
Output of Number.toLocaleString is inconsistent since version v10.3.0
Versions prior to v10.3.0 have consistent output. Tested with v8.11.2, v9.0.0, v10.0.0, v10.2.1
The text was updated successfully, but these errors were encountered: