This topic is locked

currency field format

6/17/2008 7:13:07 PM
PHPRunner General questions
B
bobby123 authorDevClub member

I have a dropdown field where my user can select PS & EURO, and a currency field where my user enters a currency amount say (100)
If the user selects PS I would like the currency field format to be set to £, if they select EURO I would like the currency field format to be set to €.
Is this possible
Thanks

Bobby

J
Jane 6/18/2008

Bobby,
to change currency format on the fly use custom format on the "View as" settings dialog on the Visual Editor tab for your currency amount field.

For example is these two fields are in one table use this code:

global $data;

if ($data["CurrencyType"]=="EURO")

$value = "€".$value;
if ($data["CurrencyType"]=="PS")

$value = "£".$value;



where CurrencyType is your actual field name.

B
bobby123 authorDevClub member 6/18/2008

Bobby,

to change currency format on the fly use custom format on the "View as" settings dialog on the Visual Editor tab for your currency amount field.

For example is these two fields are in one table use this code:
where CurrencyType is your actual field name.

B
bobby123 authorDevClub member 6/18/2008

Bobby,

to change currency format on the fly use custom format on the "View as" settings dialog on the Visual Editor tab for your currency amount field.

For example is these two fields are in one table use this code:
where CurrencyType is your actual field name.



Thanks Jane

Bobby