fix: 统一指标榜单数值精度
Build and Deploy Vue3 / build (push) Successful in 1m46s
Build and Deploy Vue3 / deploy (push) Successful in 49s

This commit is contained in:
shiran
2026-07-24 21:51:58 +08:00
parent 816771f151
commit c9e8f2ae15
+8 -1
View File
@@ -1567,7 +1567,14 @@ const getMetricTopBarPercent = (value) => {
const formatMetricTopValue = (item) => {
const value = Number(item?.value) || 0
if (item?.unit === '%' || metricTopMetric.value.endsWith('_percent')) return `${value.toFixed(2)}%`
return formatSpeedAuto(value)
const units = [
{ threshold: 1073741824, divisor: 1073741824, label: 'GB/s' },
{ threshold: 1048576, divisor: 1048576, label: 'MB/s' },
{ threshold: 1024, divisor: 1024, label: 'KB/s' }
]
const unit = units.find(option => Math.abs(value) >= option.threshold)
if (unit) return `${(value / unit.divisor).toFixed(2)} ${unit.label}`
return `${value.toFixed(2)} B/s`
}
const formatMetricTopSampleTime = (value) => {