util

package
v0.0.0-...-b3e222c Latest Latest
Warning

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

Go to latest
Published: Sep 14, 2022 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func BinaryToDecimal

func BinaryToDecimal(bit string) (num int)

二进制转10进制

func BytesToString

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

BytesToString 0 拷贝转换 slice byte 为 string

func Float32ToString

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

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

func Float64ToString

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

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

func Int2String

func Int2String(intNum int) (intStr string)

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

func Int642String

func Int642String(intNum int64) (int64Str string)

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

func RandomNumber

func RandomNumber(l int) string

随机生成数字字符串

func RandomPureString

func RandomPureString(l int) string

随机生成纯字符串

func RandomString

func RandomString(l int) string

随机生成字符串

func String2Float32

func String2Float32(floatStr string) (floatNum float32)

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

func String2Float64

func String2Float64(floatStr string) (floatNum float64)

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

func String2Int

func String2Int(intStr string) (intNum int)

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

func String2Int64

func String2Int64(intStr string) (int64Num int64)

字符串转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