1var num = 2046430;
2num.toLocaleString(undefined, {minimumFractionDigits: 2}) // 2,046,430.00
3
1var num = 2046430.123;
2num.toLocaleString(undefined, {
3 minimumFractionDigits: 2,
4 maximumFractionDigits: 2
5}) // 2,046,430.12
6
1var num = 2046430.123;
2num.toLocaleString(undefined, {
3 maximumFractionDigits: 0
4})