diff options
author | Unknwon <u@gogs.io> | 2017-03-12 01:59:48 -0500 |
---|---|---|
committer | Unknwon <u@gogs.io> | 2017-03-12 01:59:48 -0500 |
commit | bb19bb601e25201982b6b8d205d1a2d237ff22ad (patch) | |
tree | 35773ef2bdce0fbfc4189391c869a173c8dd3757 /modules/base/tool.go | |
parent | 05dbd3f7d78162bf06785faf0ea862fa2dc4f012 (diff) |
repo: able to view size (#1158)
Diffstat (limited to 'modules/base/tool.go')
-rw-r--r-- | modules/base/tool.go | 4 |
1 files changed, 2 insertions, 2 deletions
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. |