Skip to content

Commit dc7c94f

Browse files
authored
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.
1 parent 5b9f7be commit dc7c94f

File tree

1 file changed

+3
-5
lines changed

1 file changed

+3
-5
lines changed

frontend/src/ts/elements/modes-notice.ts

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ ConfigEvent.subscribe((eventKey) => {
2626
"typingSpeedUnit",
2727
"quickRestart",
2828
"customPolyglot",
29+
"alwaysShowDecimalPlaces",
2930
];
3031
if (configKeys.includes(eventKey)) {
3132
void update();
@@ -170,14 +171,11 @@ export async function update(): Promise<void> {
170171

171172
if (isAuthenticated() && avgWPM > 0) {
172173
const avgWPMText = ["speed", "both"].includes(Config.showAverage)
173-
? Format.typingSpeed(avgWPM, {
174-
suffix: ` ${Config.typingSpeedUnit}`,
175-
showDecimalPlaces: false,
176-
})
174+
? Format.typingSpeed(avgWPM, { suffix: ` ${Config.typingSpeedUnit}` })
177175
: "";
178176

179177
const avgAccText = ["acc", "both"].includes(Config.showAverage)
180-
? Format.accuracy(avgAcc, { suffix: " acc", showDecimalPlaces: false })
178+
? Format.accuracy(avgAcc, { suffix: " acc" })
181179
: "";
182180

183181
const text = `${avgWPMText} ${avgAccText}`.trim();

0 commit comments

Comments
 (0)