convert

package
v0.5.5 Latest Latest
Warning

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

Go to latest
Published: May 3, 2021 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ArrayToString

func ArrayToString(array []interface{}) string

func Bool2Str

func Bool2Str(s bool) string

bool 转字符串

func BytesGB18030Decode

func BytesGB18030Decode(byteArray []byte) []byte

把 []byte 类型的数据从 GB18030 编码转为 URF-8

func BytesGB18030Encode

func BytesGB18030Encode(byteArray []byte) []byte

GB18030 []byte 把 []byte 类型的数据从 URF-8 编码转为 GB18030

func BytesGBKDecode

func BytesGBKDecode(byteArray []byte) []byte

把 []byte 类型的数据从 GBK 编码转为 URF-8

func BytesGBKEncode

func BytesGBKEncode(byteArray []byte) []byte

GBK []byte 把 []byte 类型的数据从 URF-8 编码转为 GBK

func ConvertArray2InterfaceArray added in v0.2.10

func ConvertArray2InterfaceArray(slice interface{}) ([]interface{}, bool)

func Float642Int64

func Float642Int64(num float64, retain int) int64

将float64转成精确的int64

func Int2Str

func Int2Str(s int) string

整数转字符串

func Int642Float64

func Int642Float64(num int64, retain int) float64

将int64恢复成正常的float64

func Int642str

func Int642str(s int64) string

整数转字符串

func JSONStringify added in v0.4.0

func JSONStringify(in interface{}) (success bool, retStr string)

数据序列化

func Str2Int

func Str2Int(s string) int

字符串转整数

func Str2Int64

func Str2Int64(s string) int64

字符串转整数

func Str2Uint

func Str2Uint(s string) uint

字符串转整数

func Str2Uint64

func Str2Uint64(s string) uint64

字符串转整数

func StrGB18030Decode

func StrGB18030Decode(str string) string

把 string 类型的数据从 GB18030 编码转为 URF-8

func StrGB18030Encode

func StrGB18030Encode(str string) string

GB18030 字符串 把 string 类型的数据从 GB18030 编码转为 URF-8

func StrGBKDecode

func StrGBKDecode(str string) string

把 string 类型的数据从 GBK 编码转为 URF-8

func StrGBKEncode

func StrGBKEncode(str string) string

GBK 字符串 把 string 类型的数据从 URF-8 编码转为 GBK

func StructToMap

func StructToMap(obj interface{}) map[string]interface{}

利用反射将结构体转化为map

func Uint2Decimal added in v0.2.4

func Uint2Decimal(in uint) (res decimal.Decimal)

func Uint2Str

func Uint2Str(s uint) string

整数转字符串

func Uint2str

func Uint2str(in uint) string

func Uint642Decimal added in v0.2.5

func Uint642Decimal(in uint64) (res decimal.Decimal)

func Uint642Str

func Uint642Str(s uint64) string

整数转字符串

func Uint642str

func Uint642str(in uint64) string

func Uint82str

func Uint82str(in uint8) string

func UnicodeIndex

func UnicodeIndex(str, substr string) int

对 unicode 字符串进行索引

func UnwrapToInt64

func UnwrapToInt64(num int64, retain int) int64

精准int64

func WrapToFloat64

func WrapToFloat64(num float64, retain int) float64

精准float64

Types

This section is empty.

Jump to

Keyboard shortcuts

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