How to use toLocaleString() and tofixed(2) in JavaScript - Stack Overflow

PHOTO EMBED

Fri May 13 2022 05:18:54 GMT+0000 (Coordinated Universal Time)

Saved by @bluegirlfan #javascript

var num = 2046430.123;
num.toLocaleString(undefined, {
  minimumFractionDigits: 2,
  maximumFractionDigits: 2
}) // 2,046,430.12
content_copyCOPY

https://stackoverflow.com/questions/31581011/how-to-use-tolocalestring-and-tofixed2-in-javascript