Skip to content

Commit

Permalink
Another minor fix
Browse files Browse the repository at this point in the history
  • Loading branch information
StrawberryMaster committed Nov 15, 2023
1 parent 0678e10 commit 9c16566
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions supermajority/supermajority.js
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
window.onload = () => {
const voteForm = document.getElementById("voteForm");
const resultDiv = document.getElementById("result");

voteForm.addEventListener("submit", (event) => {
event.preventDefault();

const resultDiv = document.getElementById("result");

// Get the values of the input fields
const support = parseInt(document.getElementById("support").value, 10);
const neutralLeaningSupport = parseInt(document.getElementById("neutralLeaningSupport").value, 10);
Expand Down Expand Up @@ -34,7 +35,7 @@ window.onload = () => {
const supermajority = totalSum / totalVoters;

// Format the supermajority as a percentage with two decimal places
const formattedSupermajority = Number(supermajority).toFixed(2);
const formattedSupermajority = supermajority.toFixed(2);

// Update the result div with the result
if (supermajority >= 60) {
Expand Down

0 comments on commit 9c16566

Please sign in to comment.