mirror of
https://github.com/caddyserver/caddy.git
synced 2025-03-02 08:19:40 +08:00
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:
parent
f7129b219e
commit
35e25be1a4
@ -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 {
|
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.
|
// HumanModTime returns the modified time of the file as a human-readable string.
|
||||||
|
Loading…
x
Reference in New Issue
Block a user