Script to Format Long Numbers
Every so often, the question is raised how to add delimiters (commas, or thin spaces, etc.) between groups of 3 digits in long numbers in InDesign.
It would seem like this is something a clever GREP search could do, but in fact it is not so easy as it seems. In fact, I’m not sure it’s possible with a single simple GREP.
However, it is certainly possible with a script.
To use the script below, select something GREPable (text, a text frame, etc.), and run. Choose from the dropdown list the style of formatting you want. The available options are based on The Chicago Manual of Style (15th edition, chapter 9.23).
You can also choose to ignore numbers that are only 4 digits long (this might be useful to avoid formatting 4-digit years as well).
Click here to download the script: FormatLongNumbers
Here’s a screenshot.
Have fun!

Thiago Ribnog
November 24, 2014 2:43 pmNice one! But please, in my country we use dot instead common like 4.500 etc.., If I want to change the dot for a thin space. There’s a way to do that? Help me. Thank you.
Admin
November 24, 2014 3:04 pmIf it’s just a question of changing an existing period to a thin space (rather than separating groups of digits with commas or thin spaces) you can probably get by with a simple GREP:
Find: (\d)(\.)(\d)
Change: $1~<$3 I think that should work, though I haven't tested it (but be careful: it could mess up a number of things, including URLs and file names!)
Thiago Ribnog
November 24, 2014 5:00 pmThank you for the fast response! I’ll try it!