File tree Expand file tree Collapse file tree 1 file changed +2
-2
lines changed Expand file tree Collapse file tree 1 file changed +2
-2
lines changed Original file line number Diff line number Diff line change @@ -47,7 +47,7 @@ function update_bar_text() {
47
47
let total = correct + wrong ;
48
48
let percentage = correct / total * 100 ;
49
49
document . getElementById ( "progress-bar-text" ) . innerHTML =
50
- `${ correct } /${ total } (${ percentage . toFixed ( 2 ) } %)` ;
50
+ `${ correct } /${ total } (${ percentage . toPrecision ( 3 ) } %)` ;
51
51
set_progress_bar_background ( percentage ) ;
52
52
}
53
53
@@ -204,7 +204,7 @@ function finish_classic_game() {
204
204
let finish_div = document . createElement ( "div" ) ;
205
205
finish_div . innerHTML = `
206
206
<div id="score-div">
207
- <h3>${ correct } /${ correct + wrong } (${ ( correct / ( ( correct + wrong ) || 1 ) * 100 ) . toFixed ( 2 ) } %)</h3>
207
+ <h3>${ correct } /${ correct + wrong } (${ ( correct / ( ( correct + wrong ) || 1 ) * 100 ) . toPrecision ( 3 ) } %)</h3>
208
208
</div>
209
209
<div id="restart-button-div">
210
210
<button class="start-button" id="classic-restart-button">Restart!</button>
You can’t perform that action at this time.
0 commit comments