diff --git a/frontend/src/ts/elements/last-10-average.ts b/frontend/src/ts/elements/last-10-average.ts index de8bdd402..484a50fd7 100644 --- a/frontend/src/ts/elements/last-10-average.ts +++ b/frontend/src/ts/elements/last-10-average.ts @@ -18,12 +18,10 @@ export async function update(): Promise { 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 { diff --git a/frontend/src/ts/pages/account.ts b/frontend/src/ts/pages/account.ts index 514ac06e4..0531cae0a 100644 --- a/frontend/src/ts/pages/account.ts +++ b/frontend/src/ts/pages/account.ts @@ -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); }