6
I have a simple question about toLocaleString, I didn’t know this prototype and I was testing it instead of doing the good old split and replace
var a = 10000.50
var b = a.toLocaleString('pt-BR')
console.log(b)
The output of this code should be 10.000,50, and not 10.000,5. How does he not ignore the pennies? 'Cause that’s 50 cents, and not 5.
Thank you!
He doesn’t know you want currency formatting.
– bfavaretto