Need training at your office? Request a quote for custom training.
Adobe InDesign: Left-Aligned Currency Symbols with Right-Aligned Numbers
by Barb Binder, Adobe Certified Instructor on InDesign
From a recent Rocky Mountain Training InDesign student:
Are you familiar with formatting columns of numbers in Excel? You can line up currency numbers in a format called “accounting” that lines them up by decimal AND ALSO left aligns all of the dollar signs.
In InDesign tables, I know how to decimal align numbers and I know how to left align numbers. But I can’t figure out how to do both. I found a tip when searching online that came close but it was WAY too time-consuming because you had to put in white space between the dollar sign and numbers, and when we’re talking pages and pages of numbers, that’s just not a good way to do it. Do you have a better way?
My initial thought was no, I don’t think I do. The figure-spacing option she found would work but it would be way too time consuming. As I mulled it over, she came up with this solution on her own:
This is for copying from Excel and pasting into InDesign (as opposed to “placing” in InDesign). I actually copy/paste more because lots of times it’s just sections of larger charts:
1. Edit menu > Preferences > Clipboard Handling
(Mac: InDesign > Preferences > Clipboard Handling)
2. Set When Pasting Text and Tables from Other Applications, Paste as All Information (Index Markers, Swatches, Styles, etc.) Click on OK.
3. Copy and paste the section of the Excel table into InDesign.
Works like a CHARM!
She’s right, this works well for her workflow. In the meantime, I had time to start thinking about alternatives. Wouldn’t a Right Indent Tab between the dollar sign and the numbers give her the left and right alignment she was seeking? And what if the dollar signs aren’t in the table yet? Find/Change comes to the rescue, once again. Here are two additional ideas to consider (as always, pick whatever works best for your workflow):
If the dollar signs are already in the table:
- Click an insertion point inside the table
- Table > Select > Table
- Edit > Find/Change
- Select the Text tab and set up the query as follows, then choose Change All:
Find what: $
Change to: $^y
Search: Selection
The ^y character represents a right indent tab. You can type it in from the keyboard, or click the @ symbol at the end of the row, and select Other > Right Indent Tab.
If the dollar signs need to be added to the table:
- Click an insertion point inside the table
- Table > Select > Table
- Edit > Find/Change
- Select the GREP tab and set up the query as follows, then choose Change All:
Find what: (d+)
Change to: $~y$1
Search: Selection
This one works because you are using a GREP pattern to search for one or more digits, copying them to variable, and then pasting the same numbers back into the cell, preceded by the $ and right indent tab.
In either case, if this is going to become part of your workflow, take 30 seconds to save your query so that you can easily use it again and again:
- Test the query to make sure it is working correctly.
- Click the Save Query button (the diskette icon on the top row of the Find/Change dialog box).
- Type in a logical name in the Save Query dialog box and click on OK.
- After saving a query, it will be available in the query list at the top of the Find/Change dialog box.
Final thought: Decimal-alignment and right-alignment aren’t always interchangeable. If all the numbers in your table have the same number of digits after the decimal point, and if they don’t have footnotes or parentheses, then you can use either one and get the same result. In this post, I’m explaining how to use a right indent tab, which always lines up the right edges of the numbers against the right edge of the cell, without regard to the column width. If you really need decimal alignment, then set the alignment to left, and add a regular tab (^t) after the dollar signs and set a decimal tab. This will be fussier if the columns are of varying widths, but it will get the job done.
Cool!
Thank you very much! It worked perfectly well.
This works very well!!! We have a document with lots of tables and lots narrative in which we discuss $. Can you think of any way to make this a table setup or table style?
Hi Sherry:
You can nest paragraph styles in cell styles, and cell styles in table styles. That’s what I would explore next to see if it will work for your tables. You might also want to look into Smart Styles from WoodWing to see if it can help. There is a 30-day free trial so that you can be sure prior to purchasing: https://www.woodwing.com/en/smart-styles-adobe-indesign-plugin.
~Barb
This is wonderful for what I’m trying to do! Just one question. I already have the numbers in with commas and decimals, and any time I hit “Find Next”, it’s finding just the next series of numbers after the comma or decimal. What do I need to change/add so it’s just adding the $ before each series of numbers in every particular cell? TIA?
Hi Stephanie:
How about looking for a $ at the beginning of a paragraph and replacing with a $ and a right indent tab? Just be sure to limit the find/change to the table, or double check that no real paragraphs begin with a $, which would be unusual.
GREP
Find: ^\$
Change: \$~y
~Barb