TextLabel automatically add commas to numbers

Need a local script that automatically adds commas to numbers like 1,000, 100,000, 1,000,000, 10,000,000 or 1,245, 481,193, 2,428,732 etc.

This belongs in #help-and-feedback:scripting-support.

Here’s one way you could do this:

  1. Reverse the number
  2. Loop for the length of the number with an increment of 3 and add three letters and a comma to a second string
  3. If the length of the number is divisible by 3, remove the last comma; if not, add the remaining letters
  4. Reverse the second string
1 Like