Documentation ¶
Overview ¶
Package format provides convenience functions for formatting.
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ( TimeFormatSeconds string = "02 Jan 2006 15:04:05 MST" TimeFormatSubseconds string = "02 Jan 2006 15:04:05.99 MST" )
Functions ¶
func Duration ¶
Duration is similar to the time.Duration.String method from the standard library but is more readable and shows only 3 digits of precision when duration is less than 1 minute.
func FormatBytes ¶
FormatBytes returns a string with the number of bytes specified converted into a human-friendly format with a binary multiplier (i.e. GiB).
func FormatMilli ¶ added in v0.3.4
FormatMilli formats the value in thousants as a floating point number.
func GetMiltiplier ¶ added in v0.3.3
GetMiltiplier will return the preferred base-2 multiplier (i.e. Ki, Mi, Gi) and right shift number for the specified vlaue.
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.