how do I take a number like 10000 and have it output as $10,000.00?
10000
$10,000.00
I even had a problem with String.format(...) with a
String.format(...)
could be achieved as shown below, and you could also remove trailing 00 at the end if there is no decimals
costing= () => { const cost= 1478.90 + 940; return parseFloat(cost).toFixed(2).replace(/(\d)(?=(\d{3})+(?!\d))/g, '$1,'); }