Force currency other than Dollar

riaaneloff 15 Sep, 2010
Sorry folks, I realize I may be upsetting some of you now...my apologies...I posted in the wrong forum, and couldn't find a way to move the post. Here is the original post:
Hi, I've seen that in Chrono Forms you may select a currency which forces Dollar. Does this actually display the Dollar sign when inputting? Does it display the Dollar sign when emailing? If not, does this mean that I may actually use it for ANY currency, since no symbol is affiliated with it?
If, in fact, it does display or email the actual Dollar sign, how do I circumvent this? I would like another currency to be used, and the symbol does not even need to display or send with the email. I actually only need the number format xxx,xxx,xxx.xx or more numbers and commas to the left if the number is that large.
Have followed a link to a currency issue here relating to Euros, but that doesn't seem to be the same issue that I'm looking at.
Kind regards
GreyHead 15 Sep, 2010
hi riaaneloff,

If I read the Regular Expression correctly it will check for a number with or without a $ sign / and or a - sign followed by a number as long as you like with 0-2 decimal places and with or without commas as thousands separators.

It won't handle European formatting with a comma decimal point and spaces as thousands separators.

Bob
riaaneloff 15 Sep, 2010
WOW Bob, thanks for the quick reply. Much appreciated. What you're saying is excellent. Is there a way to force the commas?
riaaneloff 15 Sep, 2010
Ok, I used the wizard to create the form, and upon setting up the amount field, I selected under validation, that it should validate currency. This does not seem to help, unless the currency also does not force decimals. This means that it does not force decimals, and it does not force the commas. The main concern for my client is decimals. Commas are optional, but would be nice.
Since this does not seem to do it, i went into the form in non-wizard mode, and went to the validation tab from there.
I enabled live Javascript validation, and input the field name of the amount into the space where currency validation is shown.
Again, no joy.
I scoured the chronoengine site (I've been at this for HOURS!!!, and googled for php validation scripts for simple decimal force and comma force, but with no joy. The script that Bob posted in reply to the Euros I could not get to function, maybe I'm just too slow (stupid?!) with php? Obviously the one that was shown there added the option of a comma, which I removed, and it added the option of a plus or minus sign, which i also removed, but still, it seems I cannot get the form to force decimals as in normal currency.
I am actually so wasted now, that I really don't even care about the commas. But I do need to somehow get the decimals forced. Client will be satisfied with no commas, but not with no decimals.
Any assistance would be much appreciated.
GreyHead 16 Sep, 2010
Hi riaaneloff,

The built in validations are fairly general and - as you've seen will accept pretty much any 'currency' like number.

If you want to enforce a particular tighter validation then you'll need a custom validation.

There's an example here but you'll need a different regexp. This should work OK

Number: Currency amount (cents mandatory)
Optional thousands separators; mandatory two-digit fraction
^[+-]?[0-9]{1,3}(?:,?[0-9]{3})*\.[0-9]{2}$



Bob
This topic is locked and no more replies can be posted.