Commit 35e25be1 authored by Matthew Holt's avatar Matthew Holt

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.
parent f7129b21
......@@ -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.
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment