I think I'can help you, except your data above isn't coming from an array, but anyways:
PHP Code:
<?php if ($row['sales']!=0){
$gp=$row['gp']/$row['sales'];
}
else {$gp=0;} ?>
we still need to change $gp into a percentage...how many decimal places do you want? Here it is rounded to two decimals of a percentage:
PHP Code:
<?php
$gp=round($gp,4);
$gp=$gp*100;
echo $gp . "%";
?>
-- This message may have been cut off and the rest will only be shown to members. To become a member, click here --