fixed cpm issues. closes #1990

This commit is contained in:
Jack 2021-10-11 14:49:28 +01:00
parent bb490fca9d
commit 83a5cb4639
2 changed files with 8 additions and 4 deletions

View file

@ -1748,7 +1748,9 @@ export async function finish(difficultyFailed = false) {
}
}
let themecolors = await ThemeColors.get();
let chartlpb = Config.alwaysShowCPM ? lpb * 5 : lpb;
let chartlpb = Misc.roundTo2(
Config.alwaysShowCPM ? lpb * 5 : lpb
).toFixed(2);
if (lpb > 0) {
ChartController.result.options.annotation.annotations.push({
enabled: false,
@ -1854,9 +1856,9 @@ export async function finish(difficultyFailed = false) {
position: annotationSide,
xAdjust: labelAdjust,
enabled: true,
content: `${tag.name} PB: ${
content: `${tag.name} PB: ${Misc.roundTo2(
Config.alwaysShowCPM ? tpb * 5 : tpb
}`,
).toFixed(2)}`,
},
});
if (annotationSide === "left") {

View file

@ -974,7 +974,9 @@ $(document).on("mouseenter", "#resultWordsHistory .words .word", (e) => {
.replace(/>/g, "&gt")}
</div>
<div class="speed">
${burst}wpm
${Math.round(Config.alwaysShowCPM ? burst * 5 : burst)}${
Config.alwaysShowCPM ? "cpm" : "wpm"
}
</div>
</div>`
);