diff options
author | Unknown <joe2010xtmf@163.com> | 2014-03-15 12:31:12 -0400 |
---|---|---|
committer | Unknown <joe2010xtmf@163.com> | 2014-03-15 12:31:12 -0400 |
commit | 8fb4b3afadaea5a335b0e13a02e44377d8714523 (patch) | |
tree | 2b3c7e164e0c79a573121e556da20ac51d61c51f /modules/base/tool.go | |
parent | 4224ef142e9b7d7f34ae7f24799d62ea787787c5 (diff) | |
download | gitea-8fb4b3afadaea5a335b0e13a02e44377d8714523.tar.gz gitea-8fb4b3afadaea5a335b0e13a02e44377d8714523.zip |
Add template func FileSize
Diffstat (limited to 'modules/base/tool.go')
-rw-r--r-- | modules/base/tool.go | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/modules/base/tool.go b/modules/base/tool.go index 8576b941cc..3f8b8ffa84 100644 --- a/modules/base/tool.go +++ b/modules/base/tool.go @@ -121,7 +121,7 @@ func humanateBytes(s uint64, base float64, sizes []string) string { } // FileSize calculates the file size and generate user-friendly string. -func FileSize(s uint64) string { +func FileSize(s int64) string { sizes := []string{"B", "KB", "MB", "GB", "TB", "PB", "EB"} return humanateBytes(uint64(s), 1024, sizes) } |