Skip to content

Commit 723cf91

Browse files
committedOct 28, 2024
fix: beautify tweak
1 parent 024bdba commit 723cf91

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed
 

‎web/src/utils/beautifyStatNumber.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -8,11 +8,11 @@ export function beautifyStatNumber(value: number, invertValue: boolean = false):
88
} else if (absValue >= 1e6) {
99
return `${commify((value / 1e6).toFixed(2))}M`;
1010
} else if (absValue >= 1e3) {
11-
return `${commify((value / 1e3).toFixed(0))}K`;
11+
return `${commify((value / 1e3).toFixed(2))}K`;
1212
} else if (absValue > 0 && absValue < 1) {
1313
if (invertValue) {
1414
const inverseValue = 1 / absValue;
15-
return commify(inverseValue.toFixed(0));
15+
return beautifyStatNumber(Number(inverseValue));
1616
} else {
1717
return value.toFixed(2);
1818
}

0 commit comments

Comments
 (0)