Skip to main content
Kathy5FFA
Inspiring
March 6, 2025
Answered

Format Text as a Percentage

  • March 6, 2025
  • 2 replies
  • 1039 views

Hello. Is there a way to create a style or a grep that will automatically convert text to a percentage format? So for example if I type "25.5" into a text box, it automatically adds a "%" at the end to make it "25.5%"? Similar to how it works in cell formatting in Excel? I have a file that includes a lot of numbers that need to be typed in so not having to type the % character or paste it in every time would save me some time. Thank you.

Correct answer jmlevy

GREP styles (and character styles generally speaking) do not add any character, they format the text so it won't be possible that way. But you could run a find-change to add a percentage sign after all the numbers formatted in a defined style.

2 replies

jmlevy
Community Expert
jmlevyCommunity ExpertCorrect answer
Community Expert
March 6, 2025

GREP styles (and character styles generally speaking) do not add any character, they format the text so it won't be possible that way. But you could run a find-change to add a percentage sign after all the numbers formatted in a defined style.

Kathy5FFA
Kathy5FFAAuthor
Inspiring
March 6, 2025

That could work, thank you. Also is there a way to format a table cell to convert a number to a specific format like converting 1200 to 1,200 or 100 to 100.00 like in Excel? Just trying to save time from typing commas, decimals, etc. 

jmlevy
Community Expert
Community Expert
March 6, 2025

Yes, I could add a ".00" to the end of all numbers in a style. Thank you.
Do you know how I would do a find change to add a comma in all long numbers like converting 1234 to 1,234 and 10234 to 10,234? It would need to apply to all numbers of a certain length I guess. I know that's asking a lot, but I figured I'd ask just in case.


How many digits are there in your numbers?

This query works with 4 to 6 digits like 1234, 10234, 100234

Community Expert
March 6, 2025

I imagine there will be numbers that are not suppose to be formatted as a percentage. If this is the case, is there anything that distinguishes a percent number from a non-percent number?

Kathy5FFA
Kathy5FFAAuthor
Inspiring
March 6, 2025

It would be an entire table column or row so I'd like to create a paragraph or character style that when applied to any number, it would convert it to a percentage. That way I can set all numbers in a particular row to be percentages.