repo: able to view size (#1158)

This commit is contained in:
Unknwon
2017-03-12 01:59:48 -05:00
parent 05dbd3f7d7
commit bb19bb601e
13 changed files with 155 additions and 13 deletions

View File

@@ -372,7 +372,7 @@ func logn(n, b float64) float64 {
func humanateBytes(s uint64, base float64, sizes []string) string {
if s < 10 {
return fmt.Sprintf("%dB", s)
return fmt.Sprintf("%d B", s)
}
e := math.Floor(logn(float64(s), base))
suffix := sizes[int(e)]
@@ -382,7 +382,7 @@ func humanateBytes(s uint64, base float64, sizes []string) string {
f = "%.1f"
}
return fmt.Sprintf(f+"%s", val, suffix)
return fmt.Sprintf(f+" %s", val, suffix)
}
// FileSize calculates the file size and generate user-friendly string.

File diff suppressed because one or more lines are too long