func PercentFloat64(a float64, b float64) float64 {
	if b > 0 {
		return a / b
	}
	return 0
}
PercentFloat64 will safely return a percentage for two numbers diving a / b
package number
import (
	"fmt"
	"math/big"
	"strconv"
)
func ToBool(v string) bool {
	if ok, err := strconv.ParseBool(v); err == nil {
		return ok
	}
	return false
}
func ToBoolAny(v interface{}) bool {
	if v, ok := v.(bool); ok {
		return v
	}
	if v, ok := v.(*bool); ok {
		if v != nil {
			return *v
		}
		return false
	}
	if v, ok := v.(int); ok {
		return v > 0
	}
	if v, ok := v.(int32); ok {
		return v > 0
	}
	if v, ok := v.(int64); ok {
		return v > 0
	}
	if v, ok := v.(float32); ok {
		return v > 0
	}
	if v, ok := v.(float64); ok {
		return v > 0
	}
	if v, ok := v.(*int); ok {
		if v != nil {
			return *v > 0
		}
	}
	if v, ok := v.(*int32); ok {
		if v != nil {
			return *v > 0
		}
	}
	if v, ok := v.(*int64); ok {
		if v != nil {
			return *v > 0
		}
	}
	if v, ok := v.(string); ok {
		return ToBool(v)
	}
	if v, ok := v.(*string); ok {
		if v != nil {
			return ToBool(*v)
		}
	}
	return false
}
func ToInt32(v string) int32 {
	if v, err := strconv.ParseInt(v, 10, 32); err == nil {
		return int32(v)
	}
	return 0
}
func ToInt32Any(v interface{}) int32 {
	if v, ok := v.(int); ok {
		return int32(v)
	}
	if v, ok := v.(int32); ok {
		return v
	}
	if v, ok := v.(int64); ok {
		return int32(v)
	}
	if v, ok := v.(float32); ok {
		return int32(v)
	}
	if v, ok := v.(float64); ok {
		return int32(v)
	}
	if v, ok := v.(*int); ok {
		if v != nil {
			return int32(*v)
		}
	}
	if v, ok := v.(*int32); ok {
		if v != nil {
			return *v
		}
	}
	if v, ok := v.(*int64); ok {
		if v != nil {
			return int32(*v)
		}
	}
	if v, ok := v.(string); ok {
		return ToInt32(v)
	}
	if v, ok := v.(*string); ok {
		if v != nil {
			return ToInt32(*v)
		}
	}
	return 0
}
func ToInt64(v string) int64 {
	if v, err := strconv.ParseInt(v, 10, 64); err == nil {
		return v
	}
	return 0
}
func ToInt64Any(v interface{}) int64 {
	if v, ok := v.(int); ok {
		return int64(v)
	}
	if v, ok := v.(int32); ok {
		return int64(v)
	}
	if v, ok := v.(int64); ok {
		return v
	}
	if v, ok := v.(float32); ok {
		return int64(v)
	}
	if v, ok := v.(float64); ok {
		return int64(v)
	}
	if v, ok := v.(*int); ok {
		if v != nil {
			return int64(*v)
		}
	}
	if v, ok := v.(*int32); ok {
		if v != nil {
			return int64(*v)
		}
	}
	if v, ok := v.(*int64); ok {
		if v != nil {
			return int64(*v)
		}
	}
	if v, ok := v.(string); ok {
		return ToInt64(v)
	}
	if v, ok := v.(*string); ok {
		if v != nil {
			return ToInt64(*v)
		}
	}
	return 0
}
func ToFloat64(v string) float64 {
	if v, err := strconv.ParseFloat(v, 64); err == nil {
		return v
	}
	return 0
}
func ToFloat64Any(v interface{}) float64 {
	if v, ok := v.(int); ok {
		return float64(v)
	}
	if v, ok := v.(int32); ok {
		return float64(v)
	}
	if v, ok := v.(int64); ok {
		return float64(v)
	}
	if v, ok := v.(float32); ok {
		return float64(v)
	}
	if v, ok := v.(float64); ok {
		return v
	}
	if v, ok := v.(*int); ok {
		if v != nil {
			return float64(*v)
		}
	}
	if v, ok := v.(*int32); ok {
		if v != nil {
			return float64(*v)
		}
	}
	if v, ok := v.(*int64); ok {
		if v != nil {
			return float64(*v)
		}
	}
	if v, ok := v.(string); ok {
		return ToFloat64(v)
	}
	if v, ok := v.(*string); ok {
		if v != nil {
			return ToFloat64(*v)
		}
	}
	return 0.0
}
func BoolToStringAsInt(bo bool) string {
	if bo {
		return "1"
	}
	return "0"
}
func BoolPointer(v bool) *bool {
	return &v
}
func Int64Pointer(v int64) *int64 {
	if v == 0 {
		return nil
	}
	return &v
}
func Int32Pointer(v int32) *int32 {
	if v == 0 {
		return nil
	}
	return &v
}
func IntPointer(v int) *int {
	if v == 0 {
		return nil
	}
	return &v
}
func Float32Pointer(v float32) *float32 {
	return &v
}
func Float64Pointer(v float64) *float64 {
	return &v
}
func NullString(value interface{}) string {
	if value == nil {
		return "NULL"
	}
	if s, ok := value.(string); ok {
		if s == "" {
			return "NULL"
		}
		return s
	}
	if s, ok := value.(*string); ok {
		if s == nil || *s == "" {
			return "NULL"
		}
		return *s
	}
	if s, ok := value.(int); ok {
		if s == 0 {
			return "NULL"
		}
	}
	if s, ok := value.(int32); ok {
		if s == 0 {
			return "NULL"
		}
	}
	if s, ok := value.(int64); ok {
		if s == 0 {
			return "NULL"
		}
	}
	return fmt.Sprintf("%v", value)
}
var (
	bigIECExp = big.NewInt(1024)
	BigByte = big.NewInt(1)
	BigKByte = (&big.Int{}).Mul(BigByte, bigIECExp)
	BigMByte = (&big.Int{}).Mul(BigKByte, bigIECExp)
	BigGByte = (&big.Int{}).Mul(BigMByte, bigIECExp)
	BigTByte = (&big.Int{}).Mul(BigGByte, bigIECExp)
	BigPByte = (&big.Int{}).Mul(BigTByte, bigIECExp)
	BigEByte = (&big.Int{}).Mul(BigPByte, bigIECExp)
	BigZByte = (&big.Int{}).Mul(BigEByte, bigIECExp)
	BigYByte = (&big.Int{}).Mul(BigZByte, bigIECExp)
)
var ten = big.NewInt(10)
func oomm(n, b *big.Int, maxmag int) (float64, int) {
	mag := 0
	m := &big.Int{}
	for n.Cmp(b) >= 0 {
		n.DivMod(n, b, m)
		mag++
		if mag == maxmag && maxmag >= 0 {
			break
		}
	}
	return float64(n.Int64()) + (float64(m.Int64()) / float64(b.Int64())), mag
}
func humanateBigBytes(s, base *big.Int, sizes []string) string {
	if s.Cmp(ten) < 0 {
		return fmt.Sprintf("%d B", s)
	}
	c := (&big.Int{}).Set(s)
	val, mag := oomm(c, base, len(sizes)-1)
	suffix := sizes[mag]
	f := "%.0f %s"
	if val < 10 {
		f = "%.1f %s"
	}
	return fmt.Sprintf(f, val, suffix)
}
func ToBytesSizeBigInt(s *big.Int) string {
	sizes := []string{"B", "kB", "MB", "GB", "TB", "PB", "EB", "ZB", "YB"}
	return humanateBigBytes(s, bigIECExp, sizes)
}
func ToBytesSize(v int64) string {
	return ToBytesSizeBigInt(big.NewInt(v))
}
func Percent(a int, b int) float64 {
	if b > 0 {
		return float64(a) / float64(b)
	}
	return 0
}
func Percent32(a int32, b int32) float64 {
	if b > 0 {
		return float64(a) / float64(b)
	}
	return 0
}
func Percent64(a int64, b int64) float64 {
	if b > 0 {
		return float64(a) / float64(b)
	}
	return 0
}
func PercentFloat32(a float32, b float32) float64 {
	if b > 0 {
		return float64(a) / float64(b)
	}
	return 0
}