mirror of
https://github.com/monkeytypegame/monkeytype.git
synced 2025-10-27 09:16:13 +08:00
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.
This commit is contained in:
parent
5b9f7be35f
commit
dc7c94f6cc
1 changed files with 3 additions and 5 deletions
|
|
@ -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<void> {
|
|||
|
||||
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();
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue