mirror of
https://github.com/monkeytypegame/monkeytype.git
synced 2025-03-11 06:05:16 +08:00
made sure wpm and raw doesnt show NaN
This commit is contained in:
parent
edd963816c
commit
dc808e5447
1 changed files with 2 additions and 2 deletions
|
@ -631,8 +631,8 @@ function calculateStats() {
|
|||
let wpmraw = roundTo2(((chars.allCorrectChars + chars.spaces + chars.incorrectChars + chars.extraChars) * (60/testSeconds))/5);
|
||||
let acc = roundTo2((accuracyStats.correct / (accuracyStats.correct + accuracyStats.incorrect)) * 100);
|
||||
return {
|
||||
wpm: wpm,
|
||||
wpmRaw: wpmraw,
|
||||
wpm: isNaN(wpm) ? 0 : wpm,
|
||||
wpmRaw: isNaN(wpmraw) ? 0 : wpmraw,
|
||||
acc: acc,
|
||||
correctChars: chars.correctWordChars,
|
||||
incorrectChars: chars.incorrectChars + chars.extraChars + chars.missedChars,
|
||||
|
|
Loading…
Reference in a new issue