feat: 优化前端数值格式

This commit is contained in:
tbphp
2025-07-14 08:49:26 +08:00
parent 807b766e79
commit f759c17fa0
3 changed files with 22 additions and 22 deletions

View File

@@ -177,9 +177,10 @@ const generateAreaPath = (data: number[]) => {
// 数字格式化
const formatNumber = (value: number) => {
if (value >= 1000000) {
return `${(value / 1000000).toFixed(1)}M`;
} else if (value >= 1000) {
// if (value >= 1000000) {
// return `${(value / 1000000).toFixed(1)}M`;
// } else
if (value >= 1000) {
return `${(value / 1000).toFixed(1)}K`;
}
return Math.round(value).toString();