Documentation
¶
Overview ¶
Package humanize provides utility type to format values in a readable manner. It focuse on concision over precision.
Index ¶
Examples ¶
Constants ¶
View Source
const ( Day = 24 * time.Hour // a day Week = 7 * Day // a Week Month = 30 * Day // a Month Year = 365 * Day // a Year )
Missing time package constants for larger times
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ByteSize ¶
type ByteSize int64
A ByteSize represents a number of bytes, that formats itself using IEC binary prefixes with a radix of 2^10 (1024) like KiB, MiB GiB. It cannot go beyond a fe EbbiByte because we use int64.
Example ¶
fmt.Printf("%s\n", ByteSize(123456))
Output: 120.6 KiB
Click to show internal directories.
Click to hide internal directories.