package
0.0.0-20240819164739-f47aed85de5a
Repository: https://github.com/unix-world/smartgo.git
Documentation: pkg.go.dev
# README
conv
A Go package for converting various primitive types.
Designed to follow ECMA-262,
therefore it differs slightly from how the built in strconv
package works.
Please see the docs for more details.
Functions
Ttoi(t bool) int64 // bool -> int64
Ttou(t bool) uint64 // bool -> uint64
Ttof(t bool) float64 // bool -> float64
Ttoa(t bool) string // bool -> string
Ttov(t bool) any // bool -> any
Ftot(f float64) bool // float64 -> bool
Ftoi(f float64) int64 // float64 -> int64
Ftou(f float64) uint64 // float64 -> uint64
Ftoa(f float64) string // float64 -> string
Ftov(f float64) any // float64 -> any
Itot(i int64) bool // int64 -> bool
Itof(i int64) float64 // int64 -> float64
Itou(i int64) uint64 // int64 -> uint64
Itoa(i int64) string // int64 -> string
Itov(i int64) any // int64 -> any
Utot(u uint64) bool // uint64 -> bool
Utof(u uint64) float64 // uint64 -> float64
Utoi(u uint64) int64 // uint64 -> int64
Utoa(u uint64) string // uint64 -> string
Utov(u uint64) any // uint64 -> any
Atot(a string) bool // string -> bool
Atof(a string) float64 // string -> float64
Atoi(a string) int64 // string -> int64
Atou(a string) uint64 // string -> uint64
Atov(a string) any // string -> any
Vtot(v any) bool // any -> bool
Vtof(v any) float64 // any -> float64
Vtoi(v any) int64 // any -> int64
Vtou(v any) uint64 // any -> uint64
Vtoa(v any) string // any -> string
# Functions
Atof converts string to float64 For infinte numbers use 'Infinity' or '-Infinity', not 'Inf' or '-Inf'.
Atoi converts string to int64 Returns 0 for invalid syntax.
Atot converts string to bool Always returns true unless string is empty.
Atou converts string to uint64 Returns 0 for invalid syntax.
Atov converts string to any.
Ftoa converts float64 to string Returns 'Infinity' or '-Infinity', not 'Inf' or '-Inf', for infinite numbers.
Ftoi converts float64 to int64.
Ftot converts float64 to bool.
Ftou converts float64 to uint64.
Ftov converts float64 to any.
Itoa converts int64 to string.
Itof converts int64 to float64.
Itot converts int64 to bool.
Itou converts int64 to uint64.
Itov converts int64 to any.
Ttoa converts bool to string.
Ttof converts bool to float64.
Ttoi converts bool to int64.
Ttou converts bool to uint64.
Ttov converts bool to any.
Utoa converts uint64 to string.
Utof converts uint64 to float64.
Utoi converts uint64 to int64.
Itot converts uint64 to bool.
Utov converts uint64 to any.
Vtoa converts any to string.
Vtof converts any to float64.
Vtoi converts any to int64.
Vtot converts any to bool.
Vtou converts any to uint64.