Back

If your email is not recognized and you believe it should be, please contact us.

  • You must be logged in to reply to this topic.Login

Add comma to numbers

Tagged: , ,

Return to Member Forum

  • Author
    Posts
    • #73909
      Cindy Kelley
      Participant

      HI,

      I need to format long dollar numbers such at $1234567 to $1,234,567 and am a bit confused about how to write the Grep Find/Change. Can someone brilliant help me out?

      Also, can I do this with Grep Styles or does it have to be Find/Change?

      Thanks for your help and knowledge.

      Cindy

    • #73910
      Anonymous
      Inactive

      Hi,

      What about
      FIND : (\$\d+)(\d{3})(\d{3})
      REP : $1,$2,$3

      ?

      HTH,

      Loïc

      Accueil

    • #73912
      Cindy Kelley
      Participant

      Thanks Loic!

      That worked with dollar amounts with 7 digits but I also need it for numbers as small as just 4 digits, i.e. $1,234 or $12,345. Is that possible?

    • #73917
      Anonymous
      Inactive

      I don’t see a good way to make this generic without making two (or more) passes. Change the FIND to (\$\d+)(\d{3}) and run the grep search/replace again. You can do this with just two clicks of the mouse (change all) assuming there are no numbers you don’t want changed in the selection/story/document. Otherwise you will have to manually approve each change (but you are doing that now if this is the case).

      Either that or you resort to a simple script.

      Jake

    • #73924
      Cindy Kelley
      Participant

      Thanks everyone. I ended up making three find/change queries. Since I use the awesome Multi Find/Change app, it’s a one-click solution. Although it would be nice to have a script. My saved Find/Change list is getting a big long. :)

Viewing 4 reply threads
  • You must be logged in to reply to this topic.
Forum Ads