var computeST = 2145523
var resultFormat= <-- format the computeST here -->
alert(resultFormat);
the display alert should be
2,145,523
Anyone can help me?
To display price/currency without decimal point or fraction digits, use Intl.NumberFormat with a few parameters maximumFractionDigits and minimumFractionDigits set to 0.
An example:
new Intl.NumberFormat(undefined, {
style: 'currency',
currency: 'USD',
maximumFractionDigits: 0,
minimumFractionDigits: 0,
}).format(1050.55)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With