Answer the question
In order to leave comments, you need to log in
How to calculate the percentage difference between two numbers?
I want to calculate the percentage difference between two numbers.
Like in the picture I want to do:
The formula a / b * 100 does not fit.
Answer the question
In order to leave comments, you need to log in
12 / (12+16) * 100 - - - win rate
16 / (12+16) * 100 - - - loss rate
12+16 - - - total games
The formula a / b * 100 is not suitable.
I also want to remind you about one nuance: if the calculations are in integers. then a/(a+b) will give 0, and in the end it will also be 0. So don't forget to float(). And for integer percentages, I do this: a * 100 / (a + b). True, if the numbers are large, we must not forget about the possibility of overflow at the moment *100. So it's better to float $-)
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question