add back moved code to git

This commit is contained in:
2026-07-13 15:49:34 +08:00
parent 071dac67c1
commit c038275e11
+10
View File
@@ -0,0 +1,10 @@
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)}亿`;
}
if (compact && normalizedValue >= 10_000) {
return `${(normalizedValue / 10_000).toFixed(1)}`;
}
return normalizedValue.toLocaleString('zh-CN');
}