From dc7c94f6cc097f2329a499b6e31689bd9ed15c11 Mon Sep 17 00:00:00 2001 From: Blerru <44450511+blru@users.noreply.github.com> Date: Mon, 21 Jul 2025 09:42:57 -0400 Subject: [PATCH] impr(modes-notice): make average wpm and accuracy show decimal places when appropriate (@blru) (#6749) ### Description Makes it so that the average wpm and accuracy indicators shown above the typing area have their decimals visible when the `alwaysShowDecimalPlaces` config option is set to true. ### Checks - [x] Check if any open issues are related to this PR; if so, be sure to tag them below. - [x] Make sure the PR title follows the Conventional Commits standard. (https://www.conventionalcommits.org for more info) - [x] Make sure to include your GitHub username prefixed with @ inside parentheses at the end of the PR title. --- frontend/src/ts/elements/modes-notice.ts | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/frontend/src/ts/elements/modes-notice.ts b/frontend/src/ts/elements/modes-notice.ts index 2aca2b18f..d0f8f9126 100644 --- a/frontend/src/ts/elements/modes-notice.ts +++ b/frontend/src/ts/elements/modes-notice.ts @@ -26,6 +26,7 @@ ConfigEvent.subscribe((eventKey) => { "typingSpeedUnit", "quickRestart", "customPolyglot", + "alwaysShowDecimalPlaces", ]; if (configKeys.includes(eventKey)) { void update(); @@ -170,14 +171,11 @@ export async function update(): Promise { if (isAuthenticated() && avgWPM > 0) { const avgWPMText = ["speed", "both"].includes(Config.showAverage) - ? Format.typingSpeed(avgWPM, { - suffix: ` ${Config.typingSpeedUnit}`, - showDecimalPlaces: false, - }) + ? Format.typingSpeed(avgWPM, { suffix: ` ${Config.typingSpeedUnit}` }) : ""; const avgAccText = ["acc", "both"].includes(Config.showAverage) - ? Format.accuracy(avgAcc, { suffix: " acc", showDecimalPlaces: false }) + ? Format.accuracy(avgAcc, { suffix: " acc" }) : ""; const text = `${avgWPMText} ${avgAccText}`.trim();