summaryrefslogtreecommitdiffstats
path: root/modules/base/tool.go
diff options
context:
space:
mode:
authorUnknown <joe2010xtmf@163.com>2014-03-15 12:31:12 -0400
committerUnknown <joe2010xtmf@163.com>2014-03-15 12:31:12 -0400
commit8fb4b3afadaea5a335b0e13a02e44377d8714523 (patch)
tree2b3c7e164e0c79a573121e556da20ac51d61c51f /modules/base/tool.go
parent4224ef142e9b7d7f34ae7f24799d62ea787787c5 (diff)
downloadgitea-8fb4b3afadaea5a335b0e13a02e44377d8714523.tar.gz
gitea-8fb4b3afadaea5a335b0e13a02e44377d8714523.zip
Add template func FileSize
Diffstat (limited to 'modules/base/tool.go')
-rw-r--r--modules/base/tool.go2
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)
}