生产监控看板
This commit is contained in:
@@ -295,3 +295,15 @@ export function getPath(path) {
|
||||
}
|
||||
return Math.floor(divisor/dividend*100)/100;
|
||||
}
|
||||
|
||||
// 通用千分位格式化函数
|
||||
export function formatThousands(value) {
|
||||
if (value === null || value === undefined) return '0'
|
||||
|
||||
// 清理已有逗号并转为数字
|
||||
const numValue = Number(String(value).replace(/,/g, ''))
|
||||
if (isNaN(numValue)) return '0'
|
||||
|
||||
// 支持小数处理
|
||||
return numValue.toLocaleString('en-US')
|
||||
}
|
||||
Reference in New Issue
Block a user