Forum Discussion
KimGabites
4 years agoCommunity Member
Help with Java Script to format numbers
Hi everyone
Thank you for the awesome help on my last query around the characters. I have a new challenge I am hoping someone expert in java-script can help me with please. I am brand new to it, s...
SteveGannon
4 years agoCommunity Member
Kim,
If you do not want any decimal places, try replacing your third line of code with this line:
var TotAvailSav=TotAvailSav.toFixed().replace(/(\d)(?=(\d\d\d)+(?!\d))/g, '$&,');
If you do want two decimal places, keep your current third line but change...
toFixed(0)
...to...
toFixed(2)
MathNotermans-9
4 years agoCommunity Member
Regex Master Steve to the rescue ;-)
Related Content
- 10 months ago
- 8 months ago
- 5 months ago
- 2 months ago