优化坐标轴单位

This commit is contained in:
刘祥超
2021-12-12 21:13:55 +08:00
parent fdc3ebb5c5
commit 05f08eeb4c

View File

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