态势感知平台-首页概览的数据格式修改

This commit is contained in:
d266377
2026-02-02 09:34:00 +08:00
parent 3fc27a684b
commit 483c6d5c6b
4 changed files with 821 additions and 349 deletions

View File

@@ -38,11 +38,11 @@ const loading = ref(true);
// 格式化数字的工具函数
const formatNumber = (num: number, unit: string = ''): string => {
if (num >= 100000000) {
return (num / 100000000).toFixed(1) + '亿';
return Math.floor(num / 100000000) + '亿';
} else if (num >= 10000) {
return (num / 10000).toFixed(1) + '万';
return Math.floor(num / 10000) + '万';
} else if (num >= 1000) {
return (num / 1000).toFixed(1) + '千';
return Math.floor(num / 1000) + '千';
}
return num.toString();
};
@@ -50,9 +50,9 @@ const formatNumber = (num: number, unit: string = ''): string => {
// 格式化估值的工具函数
const formatValuation = (num: number): string => {
if (num >= 100000000) {
return (num / 100000000).toFixed(1) + '亿';
return Math.floor(num / 100000000) + '亿';
} else if (num >= 10000) {
return (num / 10000).toFixed(1) + '万';
return Math.floor(num / 10000) + '万';
}
return num.toString() + '亿';
};