mirror of
https://github.com/monkeytypegame/monkeytype.git
synced 2025-02-28 00:35:25 +08:00
fixed accouracy being rounded in some places instead of floored
closes #3683
This commit is contained in:
parent
a6a7454d2e
commit
5ebd050e9c
2 changed files with 5 additions and 7 deletions
|
@ -18,12 +18,10 @@ export async function update(): Promise<void> {
|
|||
Config.difficulty,
|
||||
Config.lazyMode
|
||||
)
|
||||
)
|
||||
.map(Misc.roundTo2)
|
||||
.map((num) => (Config.alwaysShowDecimalPlaces ? Math.round(num) : num));
|
||||
).map(Misc.roundTo2);
|
||||
|
||||
averageWPM = wpm;
|
||||
averageAcc = acc;
|
||||
averageWPM = Config.alwaysShowDecimalPlaces ? wpm : Math.round(wpm);
|
||||
averageAcc = Config.alwaysShowDecimalPlaces ? acc : Math.floor(acc);
|
||||
}
|
||||
|
||||
export function getWPM(): number {
|
||||
|
|
|
@ -878,7 +878,7 @@ function fillContent(): void {
|
|||
|
||||
let averageAcc: number | string = totalAcc;
|
||||
if (Config.alwaysShowDecimalPlaces) {
|
||||
averageAcc = Misc.roundTo2(averageAcc / testCount).toFixed(2);
|
||||
averageAcc = Math.floor(averageAcc / testCount).toFixed(2);
|
||||
} else {
|
||||
averageAcc = Math.round(averageAcc / testCount);
|
||||
}
|
||||
|
@ -887,7 +887,7 @@ function fillContent(): void {
|
|||
|
||||
let averageAccLast10: number | string = totalAcc10;
|
||||
if (Config.alwaysShowDecimalPlaces) {
|
||||
averageAccLast10 = Misc.roundTo2(averageAccLast10 / last10).toFixed(2);
|
||||
averageAccLast10 = Math.floor(averageAccLast10 / last10).toFixed(2);
|
||||
} else {
|
||||
averageAccLast10 = Math.round(averageAccLast10 / last10);
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue