I think the problem is with how PHP handles floating point numbers. Sometimes if you divide a number by itself you get 0.99999999999 instead of 1 so a percentage may be generated with
<?
$percent=round((($number/$max)*100), 0);
?>
may come out slightly wrong the best bet is to put a bit of logic in to deal with these situations.
<?
function percent($number=1, $max=100)
{
if ( $number == $max )
{
return(100);
}
if ( ($number == 0) || ($max == 0) )
{
return(0);
}
return(round((($number/$max)*100),2));
}
?>
so if you call
$percent=percent($number, $max);
You should get a good response.
Mark.