Re: Basic question about adding numbers from DB
- From: "ZeldorBlat" <zeldorblat@xxxxxxxxx>
- Date: 27 Aug 2006 19:30:44 -0700
possibleas@xxxxxxxxx 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>
.
- References:
- Basic question about adding numbers from DB
- From: possibleas
- Basic question about adding numbers from DB
- Prev by Date: Basic question about adding numbers from DB
- Next by Date: Re: please explane cookies.
- Previous by thread: Basic question about adding numbers from DB
- Index(es):
Relevant Pages
|