Page 1 of 1

[SOLVED] Formatting to 2 decimal points

Posted: Thu Dec 04, 2003 6:04 am
by starsol
Is there a function to do this? I don't mean rounding, as that will leave 5 as 5, or 2.3 as 2.3, whereas I want a function that will change them to 5.00 and 2.30 respectively.

Posted: Thu Dec 04, 2003 6:05 am
by patrikG
[php_man]sprintf[/php_man] is your friend.

Posted: Thu Dec 04, 2003 6:07 am
by starsol
Cheers :)

Posted: Thu Dec 04, 2003 6:13 am
by patrikG
<--- Smile :)