mirror of
https://github.com/cheeaun/phanpy.git
synced 2024-11-21 16:55:25 +03:00
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 ? (
|
||||
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"
|
||||
|
|
Loading…
Reference in a new issue