Hi I need some advice on formating a currency value when incrementing. Explained Below:
I have set up a product to a value of £5.00 in my mysql database, if i then run a query that selects it directly and echos it to the page it appears as it should ie. £5.00
however when i want to run a query that increments alot of values to get a total it appears as a number with no decimals. ie. £5
The code i have been using is below. ANY IDEAS (its shortened to the most important areas of code)
$totalprice = 0;
while ($myrow = mysql_fetch_array($result))
{
$totalprice+= $myrow["price"];
}
echo "<td><p class=\"Text1\">£".$totalprice."</p></td>";