strconvutil
packageThis package is not in the latest version of its module.
Details
Validgo.mod file
The Go module system was introduced in Go 1.11 and is the official dependency management solution for Go.
Redistributable license
Redistributable licenses place minimal restrictions on how software can be used, modified, and redistributed.
Tagged version
Modules with tagged versions give importers more predictable builds.
Stable version
When a project reaches major version v1 it is considered stable.
- Learn more about best practices
Repository
Links
Documentation¶
Index¶
- Variables
- func AnyToString(v any) string
- 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 Atou16(s string) (uint16, error)
- func Atou32(s string) (uint32, 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 ParseInts(input string) ([]int, error)
- func ParseUint8(s string, base int) (uint8, error)
- 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")ErrValueIsOutOfRange =errors.New("value is out of range"))
var RxPlus =regexp.MustCompile(`^\+`)Functions¶
funcAnyToString¶added inv0.68.4
funcAtoiLang¶
AtoiLang provides language parsing to handlethousands separators.Number formats:https://docs.oracle.com/cd/E19455-01/806-0169/overview-9/index.html
funcAtoiOrDefault¶
AtoiOrDefault is like Atoi but takes a default valuewhich it returns in the event of a parse error.
funcCanonicalIntStringOrIgnore¶added inv0.39.0
funcChangeToFunnelPct¶
ChangeToFunnelPct converts a 1.0 == 100% based `float64` to a Funnel percentage `float64`.
funcChangeToXoXPct¶
ChangeToXoXPct converts a 1.0 == 100% based `float64` to a XoX percentage `float64`.
funcFormatBoolMore¶added inv0.55.0
funcFormatDecimal¶added inv0.42.0
func FormatDecimal[Nconstraints.Float |constraints.Integer](v N, precisionint)string
funcFormatFloat64ToAnyString¶
FormatFloat64ToAnyString is used for XoX growth.
funcFormatFloat64ToAnyStringFunnel¶
FormatFloat64ToAnyStringFunnel is used for funnels.
funcFormatFloat64ToIntStringFunnel¶
func FormatFloat64ToIntStringFunnel[Fconstraints.Float](f F)string
funcInt64Abbreviation¶
Int64Abbreviation returns integer abbreviations. For example,"1.5K", "15K", "150K", "1.5M", "15M", "150M".
funcItoa¶added inv0.50.0
func Itoa[Econstraints.Integer](e E)string
Itoa is like `strconv.Itoa()` with the additional functionality of converting `uint64` and acceptinginteger types natively via `constraints.Integer`.
funcMustParseBool¶
funcMustParseInt¶
funcParseInts¶added inv0.71.9
ParseInts parses all integers from a string, ignoring non-digit separators
funcParseUint8¶added inv0.68.9
ParseUint8 safely parses a string into a uint8 value.It returns an error if the string is not a valid numberor if the number is out of the uint8 range.
funcSliceAtotFunc¶added inv0.63.8
funcSliceItoa¶
func SliceItoa[S ~[]E, Econstraints.Integer](s S) []string
SliceItoa converts a slice of `constraints.Integer` to a slice of `string`.
funcSliceItoaMore¶added inv0.63.1
func SliceItoaMore[S ~[]E, Econstraints.Integer](s S, dedupe, sortbool) []string
SliceItoaMore converts a slice of `constraints.Integer` to a slice of `string` with additionalfunctionality to dedupe and sort.
funcUnquoteMore¶added inv0.56.0
UnquoteMore wraps `strconv.Unquote()` with additional functionality of allowing more chracterswithin single quotes.`
funcUnquoteMoreOrNot¶added inv0.56.0
UnquoteMoreOrNot wraps `UnquoteMore()`
Types¶
typeFloat64ToString¶
Float64ToString is a function type to define functions.
typeInt64ToString¶
Int64ToString is a function type to define functions.