From 2af80fd97e497001a120d6b7f446d60190153f75 Mon Sep 17 00:00:00 2001 From: Gabriel Tofvesson Date: Sat, 22 Oct 2022 07:18:42 +0200 Subject: [PATCH] Fix duplicate percent sign --- public/index.html | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/public/index.html b/public/index.html index 1877731..4d7d182 100644 --- a/public/index.html +++ b/public/index.html @@ -378,7 +378,7 @@ const newVote = document.createElement("li"); newVote.style.width = totalVotes == 0 ? `${100/activeVoteData.options.length}%` : `${(activeVoteData.votes[i] / totalVotes * 100)}%`; newVote.style.backgroundColor = `var(--vote${i + 1})`; - newVote.innerHTML = activeVoteData.options[i] + " (" + (totalVotes == 0 ? `${+(100/activeVoteData.options.length).toFixed(2)}%` : +(activeVoteData.votes[i] / totalVotes * 100).toFixed(2)) + "%)"; + newVote.innerHTML = activeVoteData.options[i] + " (" + (totalVotes == 0 ? `${+(100/activeVoteData.options.length).toFixed(2)}` : +(activeVoteData.votes[i] / totalVotes * 100).toFixed(2)) + "%)"; votes.appendChild(newVote); } } else { @@ -393,7 +393,7 @@ const votesChildren = votes.children; for (let i = 0; i < votesChildren.length; i++) { const vote = votesChildren[i]; - vote.innerHTML = activeVoteData.options[i] + " (" + (totalVotes == 0 ? `${+(100/activeVoteData.options.length).toFixed(2)}%` : +(activeVoteData.votes[i] / totalVotes * 100).toFixed(2)) + "%)"; + vote.innerHTML = activeVoteData.options[i] + " (" + (totalVotes == 0 ? `${+(100/activeVoteData.options.length).toFixed(2)}` : +(activeVoteData.votes[i] / totalVotes * 100).toFixed(2)) + "%)"; vote.style.width = totalVotes == 0 ? `${100/activeVoteData.options.length}%` : (activeVoteData.votes[i] / totalVotes * 100) + "%"; } }