currency out of postgresql
| From: | Rick Eicher II | Date: | Fri, 14 Sep 2001 16:48:59 +0000 |
| Subject: | currency out of postgresql | ||
| Groups: | php.db | ||
| Request: | Send a blank email to php-db+get-12457@lists.php.net to get a copy of this message | ||
I am trying to get two currency values from out of the database, add them
together and print the to the screen. I am using the following code.
$money = $myrow[6] + $myrow[7];
$formatted = sprintf("%01.2f", $money);
printf ("<td align=\"center\">%01.2f</td></tr>\n",
$formatted);
$myrow[] is the array that I load the database records into.
I can echo $myrow[6] & $myrow[7], which will show like $4.00 and $4000.00.
But when I add them together the come out as 0 every time. The columns in
the database are of type money. This is a postgresql database.
Does any one see the errors of my ways?
thanks,
Rick Eicher II
www.pbol.net