Documentation ¶
Overview ¶
package humanize is designed to parse and format "humanized" versions of numbers with units.
Based on: github.com/dustin/go-humanize.
Index ¶
Constants ¶
Variables ¶
This section is empty.
Functions ¶
func FormatByteRate ¶
FormatByteRate outputs the given rate of transfer "r" as the quotient of "s" (the number of bytes transferred) over "d" (the duration of time that those bytes were transferred in).
It displays the output as a quantity of a "per-unit-time" unit (i.e., B/s, MiB/s) in the most representative fashion possible, as above.
func FormatBytes ¶
FormatBytes outputs the given number of bytes "s" as a human-readable string, rounding to the nearest half within .01.
func FormatBytesUnit ¶
FormatBytesUnit outputs the given number of bytes "s" as a quantity of the given units "u" to the nearest half within .01.
func ParseByteUnit ¶
ParseByteUnit returns the number of bytes in a given unit of storage, or an error, if that unit is unrecognized.
func ParseBytes ¶
ParseBytes parses a given human-readable bytes or ibytes string into a number of bytes, or an error if the string was unable to be parsed.
Types ¶
This section is empty.