I am trying to make a function that would find the ratio of two number and return them in the format X.YY (because I would later need to format them in a table and align them).
I tried this
function divide ($numerator, $denominator)
{
if ($numerator == 0 || $denominator==0 )
return (round(0,4)*100);
else
return (round(($numerator/$denominator),4)*100);
}
But it's not working with whole numbers... it's displaying 1 instead of 1.00