Format Number as Currency in Javascript
Β· β 1 min read
Use Intl or the number prototype to format number to any specified currency.
1 2 3 4 5 6 const money = 420000; const moneyFormatted = new Intl.NumberFormat("en-US", { style: "currency", currency: "USD", }).format(money); console.log(moneyFormatted); // $420,000.00 Javascript falls back on runtime locale if you specify an unavailable locale.