Fix percentage count for multiple-choice polls
This commit is contained in:
parent
410548603f
commit
b883836f8a
1 changed files with 2 additions and 1 deletions
|
@ -287,8 +287,9 @@ function Poll({ poll }) {
|
||||||
{voted || expired ? (
|
{voted || expired ? (
|
||||||
options.map((option, i) => {
|
options.map((option, i) => {
|
||||||
const { title, votesCount: optionVotesCount } = option;
|
const { title, votesCount: optionVotesCount } = option;
|
||||||
|
const pollVotesCount = votersCount || votesCount;
|
||||||
const percentage =
|
const percentage =
|
||||||
Math.round((optionVotesCount / votesCount) * 100) || 0;
|
Math.round((optionVotesCount / pollVotesCount) * 100) || 0;
|
||||||
return (
|
return (
|
||||||
<div
|
<div
|
||||||
class="poll-option"
|
class="poll-option"
|
||||||
|
|
Loading…
Add table
Reference in a new issue