Skip to main content
Participant
September 24, 2023
質問

Help to move the position of the currency symbol, from the beginning to the end of text line

  • September 24, 2023
  • 返信数 2.
  • 1253 ビュー

Hello! 

 

I recently downloaded @Peter Kahrel, price_adjuster.jsx script, for InDesign. The script works great, and i managed to add my own currency symbol, but the only problem i have, is how do i change the code so the position of the currency symbol, will be placed from the beginning of the text line, to the end of the text line? For example: 

Instead of: 

€5.500

 

Then i want it to look like:

5.500€

 

In advance, thank you very much! 

返信数 2

Peter Kahrel
Community Expert
Community Expert
September 25, 2023

Eugene's GREP matches numbers that end in a period and three digits. To find any number preceded by a Euro symbol, use this expression:

 

(€)([\d.,]+\d)

 

(and still replace with $2$1)

Participant
March 7, 2025

Hi, how would I go about to change my french formated formats to english?
I want to change the decimal and dollar position: 
19,99 $ becomes $19.99
Is that possible?

 

Peter Kahrel
Community Expert
Community Expert
March 7, 2025
Find what: (\d+),(\d+)\s?\$
Change to: $$1.$2
Community Expert
September 25, 2023

You can do that with a find and replace

 

In the GREP section of Find Replace

Find

(€)(\d+\.\d{3})

 Replace with

$2$1

 

This finds €

as it's in brackets it remembers it

 

Then finds a digit up to any amount so 1 or 12 or 130 or 1400 etc.

Then a full stop

then exactly 3 digits

so any number e.g., 10202.000

 

Because it's in brackets too it is also remembered

 

then 

$2$1

 

This taking the 2nd found string and putting it first

And putting the 1st found string at the end

 

The result should be

from €5.000

to 5.000€

Participant
September 25, 2023

Hello! Thanks for the quick reply! I can't seem to find (€)(\d+\,\d{3})

in the code. Can you specify for me, how i find the GREP section of Find Replace? 

Community Expert
September 25, 2023

That's not the code I gave you.
And it won't be part of the script.

 

You use InDesign to do the Find Change
https://helpx.adobe.com/ie/indesign/using/find-replace-grep-queries.html