#Astro compiles .toLocaleString differently from the Browser
1 messages · Page 1 of 1 (latest)
TS gets transpiled to JS, so probably not.
Have you tried different browsers?
Have you tried your code on StackBlitz or CodePen?
That might help you determine which is "standard" and which is different.
i've seen 2 stackoverflow issues, they point to different versioning/standards
i'll try StackBlitz or CodePen
but all i need is for it to be consistent
maybe i have to be more specific on the options on the format
I looked for thousandth separator, but didn't find anything.
Maybe you can use this:
https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl/NumberFormat/resolvedOptions
Looks like it's called group separator. You can use this function to get all the parts, edit that one value { type: "group", value: " " }, and then then put it back together as a string.
https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl/NumberFormat/formatToParts