Skip to content

Commit

Permalink
update 1
Browse files Browse the repository at this point in the history
  • Loading branch information
LieOnLion committed Jun 25, 2024
1 parent 1a50be1 commit a027576
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,15 +18,14 @@ async function setData () {
document.getElementById("mod1").innerHTML = mod1title + " - " + parseFloat(mod1downloads).toLocaleString('en');
document.getElementById("mod2").innerHTML = mod2title + " - " + parseFloat(mod2downloads).toLocaleString('en');

let difference = mod1downloads - mod2downloads
let aheadBy = "ahead by: "
let difference = mod1downloads - mod2downloads;
let by = "ahead by: "

if (difference < 0) {
aheadBy = "behind by: ";
difference=-difference;
by = "behind by: ";
}

document.getElementById("difference").innerHTML = aheadBy + parseFloat(difference).toLocaleString('en');
document.getElementById("difference").innerHTML = by + parseFloat(Math.abs(difference)).toLocaleString('en');
}

setData()

0 comments on commit a027576

Please sign in to comment.