Basic question about adding numbers from DB
- From: possibleas@xxxxxxxxx
- Date: 27 Aug 2006 19:12:19 -0700
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
.
- Follow-Ups:
- Re: Basic question about adding numbers from DB
- From: ZeldorBlat
- Re: Basic question about adding numbers from DB
- Prev by Date: problem uploading multiple files
- Next by Date: Re: Basic question about adding numbers from DB
- Previous by thread: problem uploading multiple files
- Next by thread: Re: Basic question about adding numbers from DB
- Index(es):