feat: extend SMS signature and setting file support #28
@@ -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) => {
|
||||
|
||||
Reference in New Issue
Block a user