Hello. I need to figure out the percentage of 2 numbers. For instance if I have 4 out of 5 that would be 80%. How do I do this with PHP? Is there some function or do I have to use math?
i doubt theres a function that does it and its a small amount of code to achieve it
$number1 = 4; $number2 = 5; $percentage = ($number1 / $number2) * 100;
OK cool. But how do I limit it to 1 decimal point?
For instance 5 out of 6 would be %83.333333333333333
How do I mkae it just say %83.3?
Thanks!
[man]math[/man]
Found it, Round() thanks!