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.
David BlatnerNovember 21, 2014 12:19 am
This looks great. Thanks! Glad you can ignore 4-digit numbers. Years ago, when I was working on Judaism For Dummies, all the history chapters came back from the editor with commas in the dates, like “the year 1,492.” They must have used some sort of macro.