diff --git a/templates/_search.html b/templates/_search.html index 69ca25af..b6baf37c 100644 --- a/templates/_search.html +++ b/templates/_search.html @@ -38,6 +38,7 @@ Name Date Downloads + Size Descending diff --git a/util/format.go b/util/format.go index fb2cbb1d..18427e83 100644 --- a/util/format.go +++ b/util/format.go @@ -7,7 +7,10 @@ import ( func FormatFilesize(bytes int64) string { var unit string var value float64 - if bytes > 1024*1024*1024 { + if bytes > 1024*1024*1024*1024 { + unit = "TiB" + value = float64(bytes) / (1024*1024*1024*1024) + } else if bytes > 1024*1024*1024 { unit = "GiB" value = float64(bytes) / (1024*1024*1024) } else if bytes > 1024*1024 {