This is part of my code.
All I am doing is adding the fields in a particular column and taking the percentage.
I am getting the right result but the result has atleast six decimal places. How can I make sure it only has two decimal places in the result?
<?
$result7 = mysql_query("select sum(marks) as sum from mydatabase");
$row7 = mysql_fetch_array($result7);
while ($row=mysql_fetch_array($result))
{
$markstotalpercent=$row7[sum]*100/240;
}
echo " $markstotalpercent ";
?>