|
Posted by ZeldorBlat on 08/28/06 02:30
possibleas@gmail.com wrote:
> Hi, I have some prices stored in a table, and after retrieving records
> like,
>
> 2.50
> 1.70
> 3.25
> 4.25
>
> I add them together with something like,
>
> <?php for ($x = 0; $x < sizeof($prices); $x++) {
> $total=$total+$prices[$x]; }?>
>
> But, when I print $total, if the amounts add up to an even number like
> 11.70, it prints out like 11.7
>
> How do I get this to express any zeros at the end? Best regards, Amy
<http://www.php.net/number_format>
<http://www.php.net/money_format>
Navigation:
[Reply to this message]
|