Documentation ¶
Index ¶
- Variables
- func Atof(s string, bitSizeIs32 bool) (float64, error)
- func AtofFunc(funcStringToFloat func(s string) (float64, error), s string) (float64, error)
- func AtofMore(s string, bitSizeIs32 bool, comma string) (float64, error)
- func Atoi16(s string) (int16, error)
- func Atoi32(s string) (int32, error)
- func Atoi8(s string) (int8, error)
- func AtoiFunc(funcStringToInt64 func(s string) (int, error), s string) (int, error)
- func AtoiLang(lang, s string) (int, error)
- func AtoiMore(s, comma, decimal string) (int, error)
- func AtoiMoreFunc(comma, decimal string) func(s string) (int, error)
- func AtoiOrDefault(s string, def int) int
- func Atou(s string) (uint, error)
- func Btoa(b bool) string
- func CanonicalIntStringOrIgnore(s, comma, decimal string) string
- func ChangeToFunnelPct(f float64) float64
- func ChangeToXoXPct(f float64) float64
- func Commify(n int64) string
- func DecimalSeparator(lang string) (string, error)
- func FormatBoolMore(b bool, trueVal, falseVal string) string
- func FormatDecimal[N constraints.Float | constraints.Integer](v N, precision int) string
- func FormatFloat64ToAnyString(f float64, pattern string) string
- func FormatFloat64ToAnyStringFunnel(f float64, pattern string) string
- func FormatFloat64ToIntString(f float64) string
- func FormatFloat64ToIntStringFunnel[F constraints.Float](f F) string
- func Ftoa[F constraints.Float](f F, prec int) string
- func Int64Abbreviation(val int64) string
- func Int64Len(val int64) int
- func Itoa[E constraints.Integer](e E) string
- func JoinBytes(data []string, sep []byte) []byte
- func MustParseBool(s string) bool
- func MustParseE164ToInt(s string) int
- func MustParseInt(s string) int
- func SliceAtof(s []string, bitSize int) ([]float64, error)
- func SliceAtoi(s []string, dedupe, sort bool) ([]int, error)
- func SliceAtotFunc(funcFormat func(s string) (time.Time, error), s []string) ([]time.Time, error)
- func SliceAtou(s []string, dedupe, sort bool) ([]uint, error)
- func SliceItoa[S ~[]E, E constraints.Integer](s S) []string
- func SliceItoaMore[S ~[]E, E constraints.Integer](s S, dedupe, sort bool) []string
- func ThousandsSeparator(lang string) (string, error)
- func UnquoteMore(s string) (string, error)
- func UnquoteMoreOrNot(s string) string
- type Float64ToString
- type Int64ToString
Constants ¶
This section is empty.
Variables ¶
var ErrValueIsNegative = errors.New("value is negative")
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 AtoiMoreFunc ¶ added in v0.63.8
func AtoiOrDefault ¶
AtoiOrDefault is like Atoi but takes a default value which it returns in the event of a parse error.
func CanonicalIntStringOrIgnore ¶ added in v0.39.0
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 DecimalSeparator ¶
func FormatBoolMore ¶ added in v0.55.0
func FormatDecimal ¶ added in v0.42.0
func FormatDecimal[N constraints.Float | constraints.Integer](v N, precision int) string
func FormatFloat64ToAnyString ¶
FormatFloat64ToAnyString is used for XoX growth.
func FormatFloat64ToAnyStringFunnel ¶
FormatFloat64ToAnyStringFunnel is used for funnels.
func FormatFloat64ToIntStringFunnel ¶
func FormatFloat64ToIntStringFunnel[F constraints.Float](f F) string
func Int64Abbreviation ¶
Int64Abbreviation returns integer abbreviations. For example, "1.5K", "15K", "150K", "1.5M", "15M", "150M".
func Itoa ¶ added in v0.50.0
func Itoa[E constraints.Integer](e E) string
Itoa is like `strconv.Itoa()` with the additional functionality of converting `uint64` and accepting integer types natively via `constraints.Integer`.
func MustParseBool ¶
func MustParseE164ToInt ¶
func MustParseInt ¶
func SliceAtotFunc ¶ added in v0.63.8
func SliceItoa ¶
func SliceItoa[S ~[]E, E constraints.Integer](s S) []string
SliceItoa converts a slice of `constraints.Integer` to a slice of `string`.
func SliceItoaMore ¶ added in v0.63.1
func SliceItoaMore[S ~[]E, E constraints.Integer](s S, dedupe, sort bool) []string
SliceItoaMore converts a slice of `constraints.Integer` to a slice of `string` with additional functionality to dedupe and sort.
func ThousandsSeparator ¶
func UnquoteMore ¶ added in v0.56.0
UnquoteMore wraps `strconv.Unquote()` with additional functionality of allowing more chracters within single quotes.`
func UnquoteMoreOrNot ¶ added in v0.56.0
UnquoteMoreOrNot wraps `UnquoteMore()`
Types ¶
type Float64ToString ¶
Float64ToString is a function type to define functions.
type Int64ToString ¶
Int64ToString is a function type to define functions.