C
Conax
Hello,
This is actually a general programming question but I don't know which
newsgroup best to put it so please pardon me.
I've always been looking for the best way to get an accurate percentage
statistics.
For example, in a election scenario:
Person A gets 33 votes
Person B gets 33 votes
Person C gets 34 votes
Person D gets 35 votes
Total votes = 33 + 33 + 34 + 35 = 135
Percent for A = 0.244.... = 0.24 = 24%
Percent for B = 0.244... = 0.24 = 24%
Percent for C = 0.251... = 0.25 = 25%
Percent for D = 0.259... = 0.26 = 26%
Then add up the percentage values: 24 + 24 + 25 + 26 = 99
(where it should be 100)
So, does anybody have a way to get around this problem? How should I
calculate the percentage for each person so that the percentage will add up
to 100 in the end?
Thanks for your help
Happy New Year
Conax
This is actually a general programming question but I don't know which
newsgroup best to put it so please pardon me.
I've always been looking for the best way to get an accurate percentage
statistics.
For example, in a election scenario:
Person A gets 33 votes
Person B gets 33 votes
Person C gets 34 votes
Person D gets 35 votes
Total votes = 33 + 33 + 34 + 35 = 135
Percent for A = 0.244.... = 0.24 = 24%
Percent for B = 0.244... = 0.24 = 24%
Percent for C = 0.251... = 0.25 = 25%
Percent for D = 0.259... = 0.26 = 26%
Then add up the percentage values: 24 + 24 + 25 + 26 = 99
(where it should be 100)
So, does anybody have a way to get around this problem? How should I
calculate the percentage for each person so that the percentage will add up
to 100 in the end?
Thanks for your help
Happy New Year
Conax