I have a simple question about toLocaleString
, I did not know this prototype and I tested 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
, not 10.000,5
. How does he not ignore the pennies? Because these are 50 cents, not 5 .
Thank you!