Documentation ¶
Overview ¶
Package fmtutil implements formatting for numbers as common meaningful values.
Index ¶
Constants ¶
View Source
const ( K = 1024 << (10 * iota) M G T P E )
Variables ¶
This section is empty.
Functions ¶
func FormatRoman ¶
FormatRoman formats an integer as Roman numerals. It panics if n < 1, much like a Roman would when confronted with the concept of zero or negative numbers.
func LongDuration ¶
LongDuration formats a duration that is most likely much longer than what package time will handle. It uses the units seconds, minutes, hours, days, weeks, months (30 days), and years (365 days).
func ShortDuration ¶
HMS formats a duration as a colon-separated timestamp.
If n is less than 60 seconds, the format will be 0:ss. If n is less than 60 minutes, the format will be m:ss. Otherwise, the format will be h:mm:ss.
func ToFormattedBytes ¶
Types ¶
Click to show internal directories.
Click to hide internal directories.