优化坐标轴单位

This commit is contained in:
GoEdgeLab
2021-12-12 21:13:55 +08:00
parent 2588c9ee2e
commit 89dd281520

View File

@@ -182,22 +182,22 @@ window.teaweb = {
let divider = 1 let divider = 1
let unit = "" let unit = ""
if (max >= Math.pow(1024, 6)) { if (max >= Math.pow(1024, 6)) {
unit = "EB" unit = "E"
divider = Math.pow(1024, 6) divider = Math.pow(1024, 6)
} else if (max >= Math.pow(1024, 5)) { } else if (max >= Math.pow(1024, 5)) {
unit = "PB" unit = "P"
divider = Math.pow(1024, 5) divider = Math.pow(1024, 5)
} else if (max >= Math.pow(1024, 4)) { } else if (max >= Math.pow(1024, 4)) {
unit = "TB" unit = "T"
divider = Math.pow(1024, 4) divider = Math.pow(1024, 4)
} else if (max >= Math.pow(1024, 3)) { } else if (max >= Math.pow(1024, 3)) {
unit = "GB" unit = "G"
divider = Math.pow(1024, 3) divider = Math.pow(1024, 3)
} else if (max >= Math.pow(1024, 2)) { } else if (max >= Math.pow(1024, 2)) {
unit = "MB" unit = "M"
divider = Math.pow(1024, 2) divider = Math.pow(1024, 2)
} else if (max >= Math.pow(1024, 1)) { } else if (max >= Math.pow(1024, 1)) {
unit = "KB" unit = "K"
divider = Math.pow(1024, 1) divider = Math.pow(1024, 1)
} }
return { return {