Points between numeric values

niwesa 17 Dec, 2012
Is it possible to create points between numeric values in some textfields?

On my form people can add a price.

Now there is for example 10000 and i want 10.000

I'm trying to get that point between the nummerics in the email results

On this page you can see what i mean, te example is by the US dollar field (but i want it for €)

http://www.pengoworks.com/workshop/js/mask/
GreyHead 18 Dec, 2012
Hi niwesa,

You can add a Custom Code action into the On Submit event and move it up before the email then add code like this
<?php
$form->data['my_input'] = number_format($form->data['my_input'], 0, ',', '.'); 
?>
See the PHP docs here for the options.

Bob
niwesa 18 Dec, 2012
Hi Bob,

Thanks a lot, the thousands are seperated by a point now.

Now i try to get the € or the word Eur. before the price.

But that is not working, do i have to maken a new custum action for that?
GreyHead 18 Dec, 2012
Hi niwesa,

The PHP money_format function perhaps?

Bob
niwesa 18 Dec, 2012
Hi Bob,

Thanks again i found the code but i get it not working, i put it in a new cust0m action, in the existing one but it doesn't do what i want.

<?php
/* money_format Nederlands */
setlocale(LC_ALL, 'nl_NL');
$locale_info = localeconv(); echo money_format('%=*^-14#8.2i',1234.56)." (".$locale_info[currency_symbol].")";   // EUR ****1234,56 (EUR)
?>


Wich parts of the code do i have to remove, and where do i have to put it?
GreyHead 19 Dec, 2012
Hi niwesa,

I'm really not sure what that is supposed to be doing. Please go back to my previous example, and to the PHP manual and work it through carefully.

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