Fix percentage count for multiple-choice polls

This commit is contained in:
Lim Chee Aun 2022-12-14 17:56:08 +08:00
parent 410548603f
commit b883836f8a

View file

@ -287,8 +287,9 @@ function Poll({ poll }) {
{voted || expired ? (
options.map((option, i) => {
const { title, votesCount: optionVotesCount } = option;
const pollVotesCount = votersCount || votesCount;
const percentage =
Math.round((optionVotesCount / votesCount) * 100) || 0;
Math.round((optionVotesCount / pollVotesCount) * 100) || 0;
return (
<div
class="poll-option"