humanize

package
v1.6.10 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 29, 2021 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func FixedMonetaryf added in v1.6.10

func FixedMonetaryf(value float64, precision int) string

FixedMonetaryf produces a fixed-precision monetary-value string. See Monetaryf.

func FormatTime

func FormatTime(time time.Time, layout string) string

FormatTime is a dropin replacement time.Format(layout) that uses system locale + LC_TIME

func Monetaryf

func Monetaryf(value float64, precision int) string

Monetaryf produces a string from of the given number give minimum precision in base 10 with thousands separators after every three orders of magnitude using thousands and decimal separator according to LC_MONETARY; defaulting "en".

e.g. Monetaryf(834142.3256, 2) -> "834,142.3256"

func Numericf

func Numericf(value float64, precision int) string

Numericf produces a string from of the given number with give fixed precision in base 10 with thousands separators after every three orders of magnitude using thousands and decimal separator according to LC_NUMERIC; defaulting "en".

e.g. Numericf(834142.32, 2) -> "834,142.32"

func Scale

func Scale(value float64) (float64, string)

Scale returns a scaled-down version of value and a suffix to add (M,B,etc.)

func ScaleNumericf

func ScaleNumericf(value float64, digits int) string

ScaleNumericf scales a large number down using a suffix, then formats it with the prescribed number of significant digits.

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL