in config.go [86:108]
func humanBytes(bytes uint) string {
v := float64(bytes)
suffix := "bytes"
if v > 1024 {
v /= 1024.
suffix = "KB"
if v > 1024. {
suffix = "MB"
v /= 1024.0
if v > 1024. {
suffix = "GB"
v /= 1024.
}
}
}
if v < 10 {
return fmt.Sprintf("%0.2f %s", v, suffix)
} else if v < 100 {
return fmt.Sprintf("%0.1f %s", v, suffix)
} else {
return fmt.Sprintf("%0.0f %s", v, suffix)
}
}