browse: Size displayed in IEC format

Powers of 2, or base 1024, rather than powers of 10 or base 1000. The powers of 2 are technically more accurate.
This commit is contained in:
Matthew Holt 2015-07-29 19:15:38 -06:00
parent f7129b219e
commit 35e25be1a4

View File

@ -120,9 +120,10 @@ func (l Listing) applySort() {
}
}
// HumanSize returns the size of the file as a human-readable string.
// HumanSize returns the size of the file as a human-readable string
// in IEC format (i.e. power of 2 or base 1024).
func (fi FileInfo) HumanSize() string {
return humanize.Bytes(uint64(fi.Size))
return humanize.IBytes(uint64(fi.Size))
}
// HumanModTime returns the modified time of the file as a human-readable string.