Documentation ¶
Index ¶
- Constants
- Variables
- func DoubleToDuration(d float64) time.Duration
- func DoubleToTime(t float64) time.Time
- func FormatCountdown(d time.Duration) string
- func FormatDate(t time.Time) string
- func FormatDateCasual(t time.Time) string
- func FormatDatetime(t time.Time) string
- func FormatDuration(d time.Duration) string
- func FormatDurationHM(d time.Duration) string
- func FormatDurationNonNegative(d time.Duration) string
- func FormatDurationWhole(d time.Duration) string
- func FormatPercentage(x float64, decimalDigits uint) string
- func FormatTime(t time.Time) string
- func FormatTimeCasual(t time.Time) string
- func HTMLMsg(m string) template.HTML
- func Numfmt(x float64) string
- func NumfmtFlexible(x float64, decimalDigits uint, trimTrailingZeros bool) string
- func NumfmtWhole(x float64) string
- func PrintTable(t [][]string)
- func TimeToDouble(t time.Time) float64
- type Unit
Constants ¶
View Source
const InfDuration = time.Duration(math.MaxInt64)
View Source
const MsgNoActiveContracts = "No active contracts. Focus on growing the home farm!"
Variables ¶
View Source
var HTMLMsgNoActiveContracts = HTMLMsg(MsgNoActiveContracts)
View Source
var Units = []Unit{
{"M", 6},
{"B", 9},
{"T", 12},
{"q", 15},
{"Q", 18},
{"s", 21},
{"S", 24},
{"o", 27},
{"N", 30},
{"d", 33},
{"U", 36},
{"D", 39},
{"Td", 42},
{"qd", 45},
{"Qd", 48},
{"sd", 51},
{"Sd", 54},
{"Od", 57},
{"Nd", 60},
{"V", 63},
{"uV", 66},
{"dV", 69},
{"tV", 72},
{"qV", 75},
{"QV", 78},
{"sV", 81},
{"SV", 84},
{"OV", 87},
{"NV", 90},
{"tT", 93},
}
Functions ¶
func DoubleToDuration ¶
DoubleToDuration converts a float64 number of seconds to Duration. +/-InfDuration is returned in the event of overflow.
func DoubleToTime ¶
DoubleToTime converts an epoch timestamp in seconds to Time. Overflow is not considered.
func FormatCountdown ¶
func FormatDate ¶
func FormatDateCasual ¶
func FormatDatetime ¶
func FormatDuration ¶
func FormatDurationHM ¶
func FormatDurationWhole ¶
func FormatPercentage ¶
func FormatTime ¶
func FormatTimeCasual ¶
func NumfmtFlexible ¶
func NumfmtWhole ¶
func PrintTable ¶
func PrintTable(t [][]string)
func TimeToDouble ¶
Types ¶
Click to show internal directories.
Click to hide internal directories.