convert

package
v0.8.1 Latest Latest
Warning

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

Go to latest
Published: Feb 22, 2023 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 to string

func BytesGb18030Decode added in v0.8.1

func BytesGb18030Decode(byteArray []byte) []byte

Convert the encoding of the []byte from GB18030 to UTF-8

func BytesGb18030Encode added in v0.8.1

func BytesGb18030Encode(byteArray []byte) []byte

GB18030 []byte Convert the encoding of the []byte from UTF-8 to GB18030

func BytesGbkDecode added in v0.8.1

func BytesGbkDecode(byteArray []byte) []byte

Convert the encoding of the []byte from GBK to UTF-8

func BytesGbkEncode added in v0.8.1

func BytesGbkEncode(byteArray []byte) []byte

GBK []byte Convert the encoding of the []byte from UTF-8 to GBK

func ConvertArray2InterfaceArray

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

func Float642Int64

func Float642Int64(num float64, retain int) int64

float64 to int64

func Int162Str added in v0.7.3

func Int162Str(s int16) string

func Int2Str

func Int2Str(s int) string

func Int322Str added in v0.7.3

func Int322Str(s int32) string

func Int642Float64

func Int642Float64(num int64, retain int) float64

int64 to float64

func Int642Str

func Int642Str(s int64) string

func Int82Str added in v0.7.3

func Int82Str(s int8) string

func JsonStringify added in v0.8.1

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

func Str2Float32

func Str2Float32(s string) float32

string to float32

func Str2Float64

func Str2Float64(s string) float64

string to float64

func Str2Int

func Str2Int(s string) int

func Str2Int16 added in v0.7.3

func Str2Int16(s string) int16

func Str2Int32 added in v0.7.3

func Str2Int32(s string) int32

func Str2Int64

func Str2Int64(s string) int64

func Str2Int8 added in v0.7.3

func Str2Int8(s string) int8

func Str2Uint

func Str2Uint(s string) uint

func Str2Uint16 added in v0.7.3

func Str2Uint16(s string) uint16

func Str2Uint32 added in v0.7.3

func Str2Uint32(s string) uint32

func Str2Uint64

func Str2Uint64(s string) uint64

func Str2Uint8 added in v0.7.3

func Str2Uint8(s string) uint8

func StrGb18030Decode added in v0.8.1

func StrGb18030Decode(str string) string

Convert the encoding of the string from GB18030 to UTF-8

func StrGb18030Encode added in v0.8.1

func StrGb18030Encode(str string) string

GB18030 string Convert the encoding of the string from GB18030 to UTF-8

func StrGbkDecode added in v0.8.1

func StrGbkDecode(str string) string

Convert the encoding of the string from GBK to UTF-8

func StrGbkEncode added in v0.8.1

func StrGbkEncode(str string) string

GBK string Convert the encoding of the string from UTF-8 to GBK

func StructToMap

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

The struct filed need tag "mapstructure"

func Uint162Str added in v0.7.3

func Uint162Str(in uint16) string

func Uint2Decimal

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

func Uint2Str

func Uint2Str(s uint) string

func Uint322Str added in v0.7.3

func Uint322Str(in uint32) string

func Uint642Decimal

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

func Uint642Str

func Uint642Str(in uint64) string

func Uint82Str

func Uint82Str(in uint8) string

func UnicodeIndex

func UnicodeIndex(str, substr string) int

Get index of unicode string

func UnwrapToInt64

func UnwrapToInt64(num int64, retain int) int64

func WrapToFloat64

func WrapToFloat64(num float64, retain int) float64

Types

This section is empty.

Jump to

Keyboard shortcuts

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