mirror of
https://github.com/monkeytypegame/monkeytype.git
synced 2025-02-24 23:04:00 +08:00
avoiding NaN
This commit is contained in:
parent
8a78e2b462
commit
cb558e291d
1 changed files with 3 additions and 1 deletions
|
@ -1421,7 +1421,9 @@ function buildCompletedEvent(difficultyFailed: boolean): CompletedEvent {
|
|||
const stddev2 = Misc.stdDev(smoothedraw);
|
||||
const avg2 = Misc.mean(smoothedraw);
|
||||
const smoothConsistency = Misc.roundTo2(Misc.kogasa(stddev2 / avg2));
|
||||
completedEvent.smoothConsistency = smoothConsistency;
|
||||
completedEvent.smoothConsistency = isNaN(smoothConsistency)
|
||||
? 0
|
||||
: smoothConsistency;
|
||||
|
||||
//wpm consistency
|
||||
const stddev3 = Misc.stdDev(completedEvent.chartData.wpm ?? []);
|
||||
|
|
Loading…
Reference in a new issue