aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--modules/base/tool.go2
-rw-r--r--templates/repo/single.tmpl2
2 files changed, 2 insertions, 2 deletions
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)
}
diff --git a/templates/repo/single.tmpl b/templates/repo/single.tmpl
index b99950ef..5774c005 100644
--- a/templates/repo/single.tmpl
+++ b/templates/repo/single.tmpl
@@ -47,7 +47,7 @@
{{if .IsDir}}
<a href="/{{$username}}/{{$reponame}}/tree/{{$branchname}}/{{.Path}}">{{.Name}}</a>
{{else}}
- <a href="#">{{.Name}} - {{.Size}}</a>
+ <a href="#">{{.Name}} - {{FileSize .Size}}</a>
{{end}}</td>
<td class="date"><time datetime="{{.Created}}" data-title="true" title="{{.Created}}">{{TimeSince .Created}}</time></td>
<td class="text">{{.Message}}</td>