mirror of
https://github.com/VueTorrent/VueTorrent.git
synced 2024-11-24 10:25:47 +03:00
fix: formatDataValues for values with 4 digits or more (#1083)
This commit is contained in:
parent
587038a7ae
commit
ad562f056a
1 changed files with 3 additions and 1 deletions
|
@ -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)
|
||||
|
||||
|
|
Loading…
Reference in a new issue