Documentation ¶
Index ¶
- Variables
- func Bytes2Number[T constraints.Integer | constraints.Float](data []byte) T
- func FormatFloat[T constraints.Float | constraints.Integer](num T, prec int) string
- func Itoa[T constraints.Integer | constraints.Float](num T) string
- func Number2Bytes[T constraints.Integer | constraints.Float](num T) []byte
- func ParseFloat[T constraints.Float](str string) (T, error)
- func ParseInteger[T constraints.Integer](str string) (T, error)
- func ParseIntegerAny[T constraints.Integer](elem any) (T, error)
- func Round[I constraints.Integer, F constraints.Float](float F) I
Constants ¶
This section is empty.
Variables ¶
View Source
var ErrNotNum = errors.New("not a number")
Functions ¶
func Bytes2Number ¶
func Bytes2Number[T constraints.Integer | constraints.Float](data []byte) T
func FormatFloat ¶
func FormatFloat[T constraints.Float | constraints.Integer](num T, prec int) string
FormatFloat 浮点数格式化成字符串.
func Number2Bytes ¶
func Number2Bytes[T constraints.Integer | constraints.Float](num T) []byte
func ParseInteger ¶
func ParseInteger[T constraints.Integer](str string) (T, error)
ParseInteger 字符串转换成整数. nolint
func ParseIntegerAny ¶
func ParseIntegerAny[T constraints.Integer](elem any) (T, error)
ParseIntegerAny 任意类型转换成数值. nolint
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.