convert

package
v0.0.3 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 2, 2024 License: Apache-2.0 Imports: 5 Imported by: 9

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AnyToBytes added in v0.0.3

func AnyToBytes(v any) (bs []byte)

func AnyToString added in v0.0.3

func AnyToString(v any) (str string)

func BinaryToDecimal

func BinaryToDecimal(bit string) (num int)

BinaryToDecimal 二进制转10进制

func BytesToString added in v0.0.3

func BytesToString(b []byte) (s string)

BytesToString 0 拷贝转换 slice byte 为 string

func Float32ToString

func Float32ToString(floatNum float32, prec ...int) (floatStr string)

Float32ToString Float32转字符串 floatNum:float32数字 prec:精度位数(不传则默认float数字精度)

func Float64ToString

func Float64ToString(floatNum float64, prec ...int) (floatStr string)

Float64ToString Float64转字符串 floatNum:float64数字 prec:精度位数(不传则默认float数字精度)

func Int2String

func Int2String(intNum int) (intStr string)

Deprecated 推荐使用 IntToString

func Int642String

func Int642String(intNum int64) (int64Str string)

Deprecated 推荐使用 Int64ToString

func Int64ToString added in v0.0.3

func Int64ToString(intNum int64) (int64Str string)

Int64ToString Int64转字符串 intNum:数字字符串

func IntToString added in v0.0.3

func IntToString(intNum int) (intStr string)

IntToString Int转字符串 intNum:数字字符串

func String2Float32

func String2Float32(floatStr string) (floatNum float32)

Deprecated 推荐使用 StringToFloat32

func String2Float64

func String2Float64(floatStr string) (floatNum float64)

Deprecated 推荐使用 StringToFloat64

func String2Int

func String2Int(intStr string) (intNum int)

Deprecated 推荐使用 StringToInt

func String2Int64

func String2Int64(intStr string) (int64Num int64)

Deprecated 推荐使用 StringToInt64

func StringToFloat32 added in v0.0.3

func StringToFloat32(floatStr string) (floatNum float32)

StringToFloat32 字符串转Float32 floatStr:小数点数字的字符串

func StringToFloat64 added in v0.0.3

func StringToFloat64(floatStr string) (floatNum float64)

StringToFloat64 字符串转Float64 floatStr:小数点数字的字符串

func StringToInt added in v0.0.3

func StringToInt(intStr string) (intNum int)

StringToInt 字符串转Int intStr:数字的字符串

func StringToInt64 added in v0.0.3

func StringToInt64(intStr string) (int64Num int64)

StringToInt64 字符串转Int64 intStr:数字的字符串

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL