Simple problem... I want to manipulate with PHP function to get desired
output below.
$var=59.9
Desired Output:
$var=59.90
I thought number_format would do the trick but no way, unless I just
missed something.. ?
Any quick way to do this using a built in PHP function? I could do it
the
[snip]
Simple problem... I want to manipulate with PHP function to get desired
output below.
$var=59.9
Desired Output:
$var=59.90
I thought number_format would do the trick but no way, unless I just
missed something.. ?
[/snip]
it is number_format http://www.php.net/number_format
it is number_format http://www.php.net/number_format
pedantry
You can also use either of the following:
http://us2.php.net/manual/en/function.sprintf.php
http://us2.php.net/manual/en/function.printf.php
echo sprintf( '%.02f', 59.9 );
/pedantry
Chris
--
PHP General Mailing List
3 matches
Mail list logo