Hello,
I am trying to get a script to properly display a percentage. I divide two numbers and get 0.0324 for what should be 3.24 How can I get this to work right?
$fin = 33 / 1019; print ("$fin%");
Thanks in advance
33/(1019/100) would give the percentage
$fin = round( 33 / (1019/100),2); print ("$fin%");
Actually, mathematically the same, but to keep it logical:
$fin = round( (33 / 1019) * 100 ),2);
Farel: 3.24 percent equals to 3.24 hundreth of one (= 0.0324). That is why you multiply with 100 to get the percentage
J.