diff options
author | Daniel Milde <daniel@milde.cz> | 2022-01-16 22:21:02 +0100 |
---|---|---|
committer | Daniel Milde <daniel@milde.cz> | 2022-01-16 22:21:02 +0100 |
commit | bccca2dc465ef2384a128231cc47db5e788d2e1a (patch) | |
tree | 47b0adf5c925aece2fdb1dff5c2f09bdba23911a /tui/format.go | |
parent | acbcedef31791d9f7d2cac56c8103013a1e8bf07 (diff) |
refactor: size constants renamed
Diffstat (limited to 'tui/format.go')
-rw-r--r-- | tui/format.go | 24 |
1 files changed, 12 insertions, 12 deletions
diff --git a/tui/format.go b/tui/format.go index 08abad6..ce51737 100644 --- a/tui/format.go +++ b/tui/format.go @@ -84,18 +84,18 @@ func (ui *UI) formatSize(size int64, reverseColor bool, transparentBg bool) stri fsize := float64(size) switch { - case fsize >= common.EB: - return fmt.Sprintf("%.1f%s EiB", fsize/common.EB, color) - case fsize >= common.PB: - return fmt.Sprintf("%.1f%s PiB", fsize/common.PB, color) - case fsize >= common.TB: - return fmt.Sprintf("%.1f%s TiB", fsize/common.TB, color) - case fsize >= common.GB: - return fmt.Sprintf("%.1f%s GiB", fsize/common.GB, color) - case fsize >= common.MB: - return fmt.Sprintf("%.1f%s MiB", fsize/common.MB, color) - case fsize >= common.KB: - return fmt.Sprintf("%.1f%s KiB", fsize/common.KB, color) + case fsize >= common.Ei: + return fmt.Sprintf("%.1f%s EiB", fsize/common.Ei, color) + case fsize >= common.Pi: + return fmt.Sprintf("%.1f%s PiB", fsize/common.Pi, color) + case fsize >= common.Ti: + return fmt.Sprintf("%.1f%s TiB", fsize/common.Ti, color) + case fsize >= common.Gi: + return fmt.Sprintf("%.1f%s GiB", fsize/common.Gi, color) + case fsize >= common.Mi: + return fmt.Sprintf("%.1f%s MiB", fsize/common.Mi, color) + case fsize >= common.Ki: + return fmt.Sprintf("%.1f%s KiB", fsize/common.Ki, color) default: return fmt.Sprintf("%d%s B", size, color) } |