-3
rated 0 times
[
0]
[
3]
/ answers: 1 / hits: 32122
/ 9 Years ago, thu, september 24, 2015, 12:00:00
var num = 1629; // this represents $16.29
num.toLocaleString(en-US, {style:currency, currency:USD});
// outputs $1,629
So far this is as close as I can come. I tried all of the options that toLocaleString provides but there seems to be no easy way to get the outcome I want (which is not as expected). Is there no built-in function that exists in JS?
More From » javascript