I'm having some troubles figuring out how to get a percentage out of two numbers. I have tried dividing then rounding but I get 0 which is of course not right. I tried looking in my new book (Core PHP Programming) in the math section but can't find anything.
this is what I'm currently using that displays 0%...
<?
$currentpage = "51";
$totalpages = "742";
$percentage = $currentpage/$totalpages;
$percentage = round($percentage);
echo "Current Page: $currentpage<BR>";
echo "Total Pages: $totalpages<BR>";
echo "Completed: $percentage%<BR>";
?>