From 8fb4b3afadaea5a335b0e13a02e44377d8714523 Mon Sep 17 00:00:00 2001 From: Unknown Date: Sat, 15 Mar 2014 12:31:12 -0400 Subject: Add template func FileSize --- modules/base/tool.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'modules') diff --git a/modules/base/tool.go b/modules/base/tool.go index 8576b941..3f8b8ffa 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) } -- cgit v1.2.3