Documentation ¶
Index ¶
- Variables
- func BoolPointer(v bool) *bool
- func BoolToStringAsInt(bo bool) string
- func Float32Pointer(v float32) *float32
- func Float64Pointer(v float64) *float64
- func Int32Pointer(v int32) *int32
- func Int64Pointer(v int64) *int64
- func IntPointer(v int) *int
- func NullString(value interface{}) string
- func Percent(a int, b int) float64
- func Percent32(a int32, b int32) float64
- func Percent64(a int64, b int64) float64
- func PercentFloat32(a float32, b float32) float64
- func PercentFloat64(a float64, b float64) float64
- func ToBool(v string) bool
- func ToBoolAny(v interface{}) bool
- func ToBytesSize(v int64) string
- func ToBytesSizeBigInt(s *big.Int) string
- func ToFloat64(v string) float64
- func ToFloat64Any(v interface{}) float64
- func ToInt32(v string) int32
- func ToInt32Any(v interface{}) int32
- func ToInt64(v string) int64
- func ToInt64Any(v interface{}) int64
Constants ¶
This section is empty.
Variables ¶
var ( // BigByte is one byte in bit.Ints BigByte = big.NewInt(1) // BigKByte is 1,024 bytes in bit.Ints BigKByte = (&big.Int{}).Mul(BigByte, bigIECExp) // BigMByte is 1,024 k bytes in bit.Ints BigMByte = (&big.Int{}).Mul(BigKByte, bigIECExp) // BigGByte is 1,024 m bytes in bit.Ints BigGByte = (&big.Int{}).Mul(BigMByte, bigIECExp) // BigTByte is 1,024 g bytes in bit.Ints BigTByte = (&big.Int{}).Mul(BigGByte, bigIECExp) // BigPByte is 1,024 t bytes in bit.Ints BigPByte = (&big.Int{}).Mul(BigTByte, bigIECExp) // BigEByte is 1,024 p bytes in bit.Ints BigEByte = (&big.Int{}).Mul(BigPByte, bigIECExp) // BigZByte is 1,024 e bytes in bit.Ints BigZByte = (&big.Int{}).Mul(BigEByte, bigIECExp) // BigYByte is 1,024 z bytes in bit.Ints BigYByte = (&big.Int{}).Mul(BigZByte, bigIECExp) )
Functions ¶
func BoolPointer ¶
BoolPointer will return a pointer to the bool value
func BoolToStringAsInt ¶
BoolToStringAsInt returns a 1 or 0 string for a bool
func Float32Pointer ¶
Float32Pointer returns a float64 as pointer
func Float64Pointer ¶
Float64Pointer returns a float64 as pointer
func Int32Pointer ¶
Int32Pointer will return the address of the value as a pointer or nil if 0
func Int64Pointer ¶
Int64Pointer will return the address of the value as a pointer or nil if 0
func IntPointer ¶
IntPointer will return the address of the value as a pointer or nil if 0
func NullString ¶
func NullString(value interface{}) string
NullString will return NULL if the value is empty or the value if not
func PercentFloat32 ¶
PercentFloat32 will safely return a percentage for two numbers diving a / b
func PercentFloat64 ¶
PercentFloat64 will safely return a percentage for two numbers diving a / b
func ToBoolAny ¶
func ToBoolAny(v interface{}) bool
ToBoolAny returns bool for interface{} and if parse error, return false
func ToBytesSize ¶
ToBytesSize produces a human readable representation of an bytes size
ToBytesSize(82854982) -> 83 MB
func ToBytesSizeBigInt ¶
ToBytesSizeBigInt produces a human readable representation of an bytes size
ToBytesSizeBigInt(big.NewInt(82854982)) -> 83 MB
func ToFloat64Any ¶
func ToFloat64Any(v interface{}) float64
ToFloat64Any converts an interface{} to a 64-bit float or return 0
func ToInt32Any ¶
func ToInt32Any(v interface{}) int32
ToInt32Any converts an interface{} to a base 10 32-bit integer or return 0
func ToInt64Any ¶
func ToInt64Any(v interface{}) int64
ToInt64Any converts an interface{} to a base 10 64-bit integer or return 0
Types ¶
This section is empty.