Copy link to clipboard
Copied
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 $
There are hundreds of numbers so I am trying to figure out a way to use the find/replace feature but I am struggling. Any advice would be greatly appreciated.
Catharine
1 Correct answer
Find: (^\$)(\d+)(,)(\d{3})\b Chage:$2 $4 $1
Copy link to clipboard
Copied
Hi,
Try this..
Find: (\d+) (\d+) (\$)
Replace: $1,$2$3
Thanks,
Prabu G
Prabu
Design smarter, faster, and bolder with InDesign scripting.
Copy link to clipboard
Copied
Find: (^\$)(\d+)(,)(\d{3})\b Chage:$2 $4 $1
Copy link to clipboard
Copied
Hi,
Nobody said it was a beginning of para.
A no-break (or thin space) before $ could be cool.
Idem as thousand separator.
Everybody suppose we'll never have more than 999,999!
Try: $1,000,000,001
(^/)
Copy link to clipboard
Copied
Hi all.
How is this expression?
find: \$ *(([1-9]{1,3}\,?([0-9]{1,3}\,?)*)+)
change: $1 $
However, this does not take decimal into consideration.
Regards,
Yusuke.
Copy link to clipboard
Copied
You have no idea how excited I am that this works!! You are a genius! Thank you so much for your response. I wish I understood enough about scripting to be able to modify this but I don't so I have 1 further request. This works for all numbers with a comma but I have many numbers that are only 2 and 3 digits long therefore not requiring the comma. ie $50 or $300 This script doesn't work for these. Are you able to give me a script that will now work on these numbers?
Catharine
Copy link to clipboard
Copied
I just realized my response did not mention who's script worked but it was uniqued_tol. Thanks again but no need to send the second one as I had requested because I realized that Obi-wan Kenobi's first script fixes the ones without commas.
Thank you everyone for taking the time to reply 🙂
Catharine
Copy link to clipboard
Copied
Supposing you could have 1 billion of dollars or just 1 dollar in your pocket, you'll need 2 regex to fix it!
1/
Find: (\$)([\d,]*\d)
Replace by: $2~s$1
2/
Find: \d\K,(?=\d)
Replace by: ~<
(^/)

