polyfill-Number.toLocaleString-with-Locales
polyfill-Number.toLocaleString-with-Locales copied to clipboard
Formatting decimals is broken when specify locale is not supported
expect(0.1000122.toLocaleString()).toEqual "0.1"
Expected '0.1,000,122' to equal '0.1'.
Sorry about the late response... Looks like a bug...
I'll take a look at it.
So, the bug with the commas after the decimal is fixed... it now returns "0.1000122", so it's just a problem with maximum accuracy... Based on some tests, it looks like chrome canary and firefox support a maximum of 3 significant digits after the decimal for toLocaleString().
I may fix this, but it is a low priority for me, right now.
If you want to fix it and submit a pull request, please do so.