From bb19bb601e25201982b6b8d205d1a2d237ff22ad Mon Sep 17 00:00:00 2001 From: Unknwon Date: Sun, 12 Mar 2017 01:59:48 -0500 Subject: repo: able to view size (#1158) --- modules/base/tool.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'modules/base/tool.go') diff --git a/modules/base/tool.go b/modules/base/tool.go index 13515ac0..af1313b2 100644 --- a/modules/base/tool.go +++ b/modules/base/tool.go @@ -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. -- cgit v1.2.3