Olivier Posted May 30, 2016 Share Posted May 30, 2016 Hi friends, I have to setup a menu card with prices composed like this : 12€90 The user in MarcomCentral portal will type the price like this : 12.90 or 12,90 as we do in France. What may be the rule to substitute the "." or "," to "€" ? Many thanks, Olivier FusionPro 9.3.36 on MacOS 10.10.5 and Acrobat Pro 10.1.16 Quote Link to comment Share on other sites More sharing options...
step Posted May 31, 2016 Share Posted May 31, 2016 return Field('Your Field').replace(/[\.,]/g,'€'); Quote Link to comment Share on other sites More sharing options...
tou Posted May 31, 2016 Share Posted May 31, 2016 I never understood the red part below and will need to read up on it some more...is it an array of characters "." ","? return Field('Your Field').replace(/[\.,]/g,'€'); Sorry and thanks in advance for the explanation. Quote Link to comment Share on other sites More sharing options...
step Posted May 31, 2016 Share Posted May 31, 2016 I never understood the red part below and will need to read up on it some more...is it an array of characters "." ","? return Field('Your Field').replace(/[\.,]/g,'€'); Sorry and thanks in advance for the explanation. There's no need to apologize. No, it's not an array – it's a regular expression. In regular expressions (or RegExps), the brackets denote a character set. In this case, the character set is a '.' and a ',' but since the '.' has a special meaning in regexps, it has to be escaped with a backslash. The 'g' at the end means to search for those characters globally – don't just find and replace the first instance. Quote Link to comment Share on other sites More sharing options...
Olivier Posted June 13, 2016 Author Share Posted June 13, 2016 Thank you friends, worked fine ! Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.