Closed ghost closed 7 years ago
It is not an error, see https://github.com/lesterchan/wp-polls/pull/29
@lesterchan OK but I think if an option has a vote count which is larger than the total voter count, the percentage for it will be more than 100% which I think it's strange.
@lesterchan And the percentage bar will also break the div container for it has a width value more than 100%
I am aware of the more than 100% bar. But I am not sure if having votes/total votes is a better result than using total voters. I will leave this open for more discussion.
@lesterchan Firstly, I've to say the percentage will reach more than 100% only when I manually change the vote count in the background, so it won't happen if all the votes are voted by real visitors. Sorry for this. So now I think it's hard to say whose calculation method is right, so I did some tests with some popular forums. Here's the screenshots as a reference.
(All the polls below are only with one voter and two votes)
(One of the largest Chinese communities)
(A famous Chinese PHP forum solution)
(Another famous Chinese PHP forum solution)
Hmm 4 forums divided by votes, 2 forums divided by voters
Just for completness, here is WP-Polls one which is divided by voters.
Fix percentage calculation error when multiple choices is allowed.