补齐亿单位泥点向下截断
Project CI / Repository checks (pull_request) Successful in 2m42s
Project CI / Frontend tests (pull_request) Successful in 3m22s
Project CI / Backend tests (pull_request) Successful in 6m53s
Project CI / Native shell tests (pull_request) Successful in 17m24s

让万和亿两个紧凑显示分支统一按一位小数向下截断
This commit is contained in:
2026-09-02 18:34:58 +08:00
parent 80cf32a0b6
commit a71bdd54fd
+1 -1
View File
@@ -1,7 +1,7 @@
export function formatMudPointCount(value: number, compact = false) {
const normalizedValue = Math.max(0, Math.round(value));
if (compact && normalizedValue >= 100_000_000) {
return `${(normalizedValue / 100_000_000).toFixed(1)}亿`;
return `${(Math.floor(normalizedValue / 10_000_000) / 10).toFixed(1)}亿`;
}
if (compact && normalizedValue >= 10_000) {
return `${(Math.floor(normalizedValue / 1_000) / 10).toFixed(1)}`;