You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm wondering why there is no option to specify the locale. After a small research I found out that it is not so easy as expected initial, but it seems to be able.
Number has the prototype toLocaleString() which does that what I would expect. See also MDN for more details. Spoiler: You need to set minimumFractionDigits and maximumFractionDigits as options.
Just for those which are not familiar the correct formatted result of 10000 divided by 3 is in en-US: 3,333.33 while in de_DE: 3.333,33.
The text was updated successfully, but these errors were encountered:
I'm wondering why there is no option to specify the locale. After a small research I found out that it is not so easy as expected initial, but it seems to be able.
Number
has the prototypetoLocaleString()
which does that what I would expect. See also MDN for more details. Spoiler: You need to setminimumFractionDigits
andmaximumFractionDigits
as options.Just for those which are not familiar the correct formatted result of 10000 divided by 3 is in
en-US
:3,333.33
while inde_DE
:3.333,33
.The text was updated successfully, but these errors were encountered: