Skip to main content
Known Participant
December 21, 2017
Question

Script for moving $ to end of numbers

  • December 21, 2017
  • 1 reply
  • 681 views

A while back I asked this question "I have an english indesign file that was translated to french.  The last thing to be changed are the dollar values.  In english they appear like this $1,200 and in french it needs to have a space followed by the dollar sign at the end of the number and with a space instead of a comma like this 1 200 $".

I was ecstatic when I was given a 2 part solution.  The first was from @uniqued_tol (thanks again) which formatted all numbers with more than 3 digits.

Find: (^\$)(\d+)(,)(\d{3}) Change: $2 $4 $1

I then ran the script by @Obi-wan Kenobi (thanks again) which formatted the remaining numbers that were 3 digits or less.

Find:  (\$)((\d+,)+\d+) Replace by:  $2~s$1

I now have another large book to format but this time there are decimal points so these scripts are not working.  I need a number like this $2,300.99 to be formatted to look like this 2 300,99 $  I have numbers with digits as small as $10.00 up to $4,500.99

Once again any help would be greatly appreciated.

Catharine

This topic has been closed for replies.

1 reply

Anantha Prabu G
Legend
December 22, 2017

Hi,

Find: (^\$)(\d+)\,(\d{3})\.(\d{2})

Change: $2 $3,$4$

Thanks,

Prabu G

Design smarter, faster, and bolder with InDesign scripting.
eseyAuthor
Known Participant
December 22, 2017

I am so excited that this gets me halfway there.  Thank you Prabu :-) So this works beautifully on digits of $1,000.00 or more but does not find anything $999.00 or less.  Are you able to modify the first one to account for this and I will just run both scripts back to back?

Thanks,

Catharine

Anantha Prabu G
Legend
December 22, 2017

Hi,

Try this.

Find: (^\$)(\d+)\.(\d{2})

Change: $2,$3 $

Thanks,

Prabu G

Design smarter, faster, and bolder with InDesign scripting.