You can use Regex which is a function that scans through text and you can use it to find and replace specific characters
Do a "set text" and paste this in the expression box. Replace "number" with the number or variable you want
RegexReplace(str(number), "\d{1,3}(?=(\d{3})+(?!\d))", "g", "$& ")[/code:2xs3l2cz]
The parameter "$& " tells what to add. If you make it "$&," it will turn 1000 into 1,000. Note that in the line above it has a space after the &, which means it's adding the space character