How do I add space as a decimal number separator? The current format is 23456.00
but it has to be 23 456
I got it to remove the .00
with toFixed
already but no luck with the space separator.
{{parseFloat(post.meta.price).toFixed(0)}}
Perhaps I can change the locale format in the code to fr-FR because that will add the space?
Perhaps I can change the locale format in the code to fr-FR because that will add the space?
Yes, you can!
price = 23456.00
disp = new Intl.NumberFormat('fr-FR').format(price)
console.log(disp)
reference: Intl.NumberFormat
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With