I have 2 numbers being generated...
Say:
1000 and 500
I want to get the percentage 500 is of 1000...
How would I do this? any help/coding examples are appreciated!
Thanks.
$percent = round(100 * $a / $b);
Hi there, this is just a simple mathematical equation.
$percentage = ($number1/$number2) * 100;
hah, that'll do it too 😉
The phrase I learned in school was:
The part divided by the whole * 100.