Re: displaying neat and tidy currency notation?

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hello George,

Try something like this:
$var = '25.5';
$var = sprintf("%.2f", $var);
echo $var;

GP> Hi,

GP> I want to be able to display the results of some calculations as currency
GP> such as £25.50, but round($var,2) produces £25.5.

GP> I've tried writing my own function but that just fouled up the calculation.

GP> Any tips or suggestions?

GP> Cheers

GP> George in Oxford




-- 
Best regards,
 re_action                            mailto:re_action@xxxxxxxxxx

-- 
PHP Windows Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[Index of Archives]     [PHP Home]     [PHP Users]     [PHP Database Programming]     [PHP Install]     [Kernel Newbies]     [Yosemite Forum]     [PHP Books]

  Powered by Linux