This topic is locked

how to set currency to 0 decimal places

11/20/2008 9:56:54 AM
PHPRunner General questions
J
jack knowles author

Hello Forum,
DB Field

paymentamount set to decimal(10,0)
Visual Editor

Edit As: Text field, Validate as Number

View As: Currency
_Events

_Add Page, Before record added: ,0);
When i enter a value such as 1201.59 via add page, it displays the results as £1202.00. I only want to display as £1202

DB field shows value as 1202

How can this be achieved.
Thank you in advance
JK

L
Lisa2006 11/20/2008

Jack,
Try the following:
Change Visual Editor | View as to Custom (not Currency) and add the following syntax
$value = "£" . number_format(($value),0);
Physcial DB field "paymentamount" will show decimal entry i.e. 1201.59, whilst users will see List & View page as £1202
Hope this helps!!!
Lisa

J
Jane 11/21/2008

Hi,
you can remove unnecessary decimal point editing generated include/locale.php file manually.

Find this line:

$locale_info["LOCALE_ICURRDIGITS"]="2";



and replace it with this one:

$locale_info["LOCALE_ICURRDIGITS"]="0";