_type

package
v1.0.2 Latest Latest
Warning

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

Go to latest
Published: Apr 7, 2024 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Empty

func Empty(val interface{}) bool

Empty 判空函数

func InIntArray

func InIntArray(k int, arr []int) bool

func InStrArray

func InStrArray(str string, arr []string) bool

func IsContainStr

func IsContainStr(str string, arr []string) bool

IsContainStr 判断数组中的字符是否在当前字符串中

func RandomNumber

func RandomNumber(length int) string

RandomNumber 生成长度为 length 随机数字字符串

func RoundToSevenDecimalPlaces

func RoundToSevenDecimalPlaces(num float64) float64

RoundToSevenDecimalPlaces 保留小数点后7位

func RoundToTwoDecimalPlaces

func RoundToTwoDecimalPlaces(num float64) float64

RoundToTwoDecimalPlaces 保留小数点后两位

func SafeFloatAdd

func SafeFloatAdd(a, b float64) float64

SafeFloatAdd 安全的浮点数相加

func ToBool

func ToBool(obj interface{}) (bool, error)

转布尔值

func ToFloat

func ToFloat(obj interface{}) (float64, error)

转浮点数

func ToInt

func ToInt(obj interface{}) (int, error)

转int

func ToMap

func ToMap(obj interface{}) (map[string]interface{}, error)

转map

func ToSlice added in v1.0.1

func ToSlice(obj interface{}) ([]interface{}, error)

转数组

func ToString

func ToString(obj interface{}) string

ToString 转字符串

Types

This section is empty.

Jump to

Keyboard shortcuts

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