Documentation ¶
Index ¶
- Variables
- func Atoi16(s string) (int16, error)
- func Atoi32(s string) (int32, error)
- func Atoi8(s string) (int8, error)
- func AtoiLang(lang, s string) (int, error)
- func AtoiOrDefault(s string, def int) int
- func ChangeToFunnelPct(v float64) float64
- func ChangeToXoXPct(v float64) float64
- func Commify(n int64) string
- func DecimalSeparator(lang string) (string, error)
- func FormatFloat64ToAnyString(v float64, pattern string) string
- func FormatFloat64ToAnyStringFunnel(v float64, pattern string) string
- func FormatFloat64ToIntString(v float64) string
- func FormatFloat64ToIntStringFunnel(v float64) string
- func Int64Abbreviation(val int64) string
- func Int64Len(val int64) int
- func MustParseBool(s string) bool
- func MustParseE164ToInt(s string) int
- func MustParseInt(s string) int
- func SliceAtoi(strings []string) ([]int, error)
- func SliceAtoiSort(strings []string) ([]int, error)
- func SliceItoa(ints []int) []string
- func ThousandsSeparator(lang string) (string, error)
- type Float64ToString
- type Int64ToString
Constants ¶
This section is empty.
Variables ¶
var RxPlus = regexp.MustCompile(`^\+`)
Functions ¶
func AtoiLang ¶
AtoiLang provides language parsing to handle thousands separators. Number formats: https://docs.oracle.com/cd/E19455-01/806-0169/overview-9/index.html
func AtoiOrDefault ¶
AtoiOrDefault is like Atoi but takes a default value which it returns in the event of a parse error.
func ChangeToFunnelPct ¶
ChangeToFunnelPct converts a 1.0 == 100% based `float64` to a Funnel percentage `float64`.
func ChangeToXoXPct ¶
ChangeToXoXPct converts a 1.0 == 100% based `float64` to a XoX percentage `float64`.
func Commify ¶
Commify takes an int64 and adds comma for every thousand Stack Overflow: http://stackoverflow.com/users/1705598/icza URL: http://stackoverflow.com/questions/13020308/how-to-fmt-printf-an-integer-with-thousands-comma
func DecimalSeparator ¶
func FormatFloat64ToAnyString ¶
FormatFloat64ToAnyString is used for XoX growth.
func FormatFloat64ToAnyStringFunnel ¶
FormatFloat64ToAnyStringFunnel is used for funnels.
func Int64Abbreviation ¶
Int64Abbreviation returns integer abbreviations. For example, "1.5K", "15K", "150K", "1.5M", "15M", "150M".
func MustParseBool ¶
func MustParseE164ToInt ¶
func MustParseInt ¶
func SliceAtoiSort ¶
SliceAtoiSort converts and sorts a slice of string integers.
func ThousandsSeparator ¶
Types ¶
type Float64ToString ¶
Float64ToString is a function type to define functions.
type Int64ToString ¶
Int64ToString is a function type to define functions.