Skip to content

Commit

Permalink
Use 3sf not 2dp
Browse files Browse the repository at this point in the history
  • Loading branch information
nayakrujul committed Jul 5, 2024
1 parent 7a4f0a2 commit eaded2b
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions scripts/folders-classic.js
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ function update_bar_text() {
let total = correct + wrong;
let percentage = correct / total * 100;
document.getElementById("progress-bar-text").innerHTML =
`${correct}/${total} (${percentage.toFixed(2)}%)`;
`${correct}/${total} (${percentage.toPrecision(3)}%)`;
set_progress_bar_background(percentage);
}

Expand Down Expand Up @@ -204,7 +204,7 @@ function finish_classic_game() {
let finish_div = document.createElement("div");
finish_div.innerHTML = `
<div id="score-div">
<h3>${correct}/${correct + wrong} (${(correct / ((correct + wrong) || 1) * 100).toFixed(2)}%)</h3>
<h3>${correct}/${correct + wrong} (${(correct / ((correct + wrong) || 1) * 100).toPrecision(3)}%)</h3>
</div>
<div id="restart-button-div">
<button class="start-button" id="classic-restart-button">Restart!</button>
Expand Down

0 comments on commit eaded2b

Please sign in to comment.