Hi Soltrance
the way you would do this is to loop through the number dividing by 1000. Then building your string by prepending the remainder to the result string inserting the comma if your base number exceeds 1000.
Something like this
let workingValue = 234567890;
let formatString = ‘’;
while (workingValue > 1000) {
let remainder = workingValue % 1000;
let workingValue /= 1000;
formatString = “,”+remainder.toString() + formatString;
}
formatString = workingValue.toString() + formatString;
console.log(formatString);