fix: formatDataValues for values with 4 digits or more (#1083)

This commit is contained in:
Jagadam Dinesh Reddy 2023-09-04 12:52:52 +05:30 committed by GitHub
parent 587038a7ae
commit ad562f056a
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -24,7 +24,9 @@ export function formatDataValue(data: number, isBinary: boolean) {
while (data >= base ** i) {
i++
}
return toPrecision(data / base ** (i - 1), i > 1 ? 3 : 1)
let value = data / base ** (i - 1)
if (value > 999) return toPrecision(value,4)
return toPrecision(value, i > 1 ? 3 : 1)
}
Vue.filter('formatDataValue', formatDataValue)