mirror of
https://github.com/go-gitea/gitea.git
synced 2026-10-26 06:16:56 +09:00
Add template func FileSize
This commit is contained in:
1 parent
4224ef142e
commit
8fb4b3afad
2 files changed
+2
-2
No files matched your search
@@ -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)
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user