Skip to content

Commit

Permalink
poll % fix
Browse files Browse the repository at this point in the history
  • Loading branch information
ItsAnkan committed Jun 29, 2023
1 parent 54d2606 commit 78d56a2
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion templates/poll_results.njk
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@
const votes = eval(ele.parentElement.parentElement.children[1].innerHTML.split(' ')[0]);
if (votes === maxVotes) ele.parentNode.parentNode.classList.add('winning');
if (votes) ele.style.width = totalVotes ? `${votes*100/totalVotes}%` : 0;
ele.firstElementChild.innerHTML = `${totalVotes ? Math.round(votes*100/totalVotes) : o}%`;
ele.firstElementChild.innerHTML = `${totalVotes ? Math.round(votes*100/totalVotes * 10)/10 : o}%`;
});
}
window.onload = () => {
Expand Down

0 comments on commit 78d56a2

Please sign in to comment.