aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--util/generic.go4
1 files changed, 2 insertions, 2 deletions
diff --git a/util/generic.go b/util/generic.go
index e844d00..2b26d60 100644
--- a/util/generic.go
+++ b/util/generic.go
@@ -52,13 +52,13 @@ func FileSizeFormat(bytes int64) string {
units := []string{"B", "KB", "MB", "GB", "TB", "PB"}
var i int
- value := bytes
+ value := float64(bytes)
for value > 1000 {
value /= 1000
i++
}
- return fmt.Sprintf("%d %s", value, units[i])
+ return fmt.Sprintf("%.1f %s", value, units[i])
}
// Truncates string to given max length, and inserts ellipsis into