|
@@ -243,6 +243,9 @@ func Int64All(num interface{}) int64 {
|
|
} else if i7, ok7 := num.(*big.Int); ok7 {
|
|
} else if i7, ok7 := num.(*big.Int); ok7 {
|
|
in, _ := strconv.ParseInt(fmt.Sprint(i7), 10, 64)
|
|
in, _ := strconv.ParseInt(fmt.Sprint(i7), 10, 64)
|
|
return int64(in)
|
|
return int64(in)
|
|
|
|
+ } else if i8, ok8 := num.(*big.Float); ok8 {
|
|
|
|
+ in, _ := strconv.ParseInt(fmt.Sprint(i8), 10, 64)
|
|
|
|
+ return int64(in)
|
|
} else {
|
|
} else {
|
|
return 0
|
|
return 0
|
|
}
|
|
}
|
|
@@ -279,6 +282,9 @@ func Float64All(num interface{}) float64 {
|
|
} else if i7, ok7 := num.(*big.Float); ok7 {
|
|
} else if i7, ok7 := num.(*big.Float); ok7 {
|
|
in, _ := strconv.ParseFloat(fmt.Sprint(i7), 64)
|
|
in, _ := strconv.ParseFloat(fmt.Sprint(i7), 64)
|
|
return float64(in)
|
|
return float64(in)
|
|
|
|
+ } else if i8, ok8 := num.(*big.Int); ok8 {
|
|
|
|
+ in, _ := strconv.ParseFloat(fmt.Sprint(i8), 64)
|
|
|
|
+ return float64(in)
|
|
} else {
|
|
} else {
|
|
return 0
|
|
return 0
|
|
}
|
|
}
|
|
@@ -305,6 +311,9 @@ func IntAllDef(num interface{}, defaultNum int) int {
|
|
} else if i7, ok7 := num.(*big.Int); ok7 {
|
|
} else if i7, ok7 := num.(*big.Int); ok7 {
|
|
in, _ := strconv.Atoi(fmt.Sprint(i7))
|
|
in, _ := strconv.Atoi(fmt.Sprint(i7))
|
|
return int(in)
|
|
return int(in)
|
|
|
|
+ } else if i8, ok8 := num.(*big.Float); ok8 {
|
|
|
|
+ in, _ := strconv.Atoi(fmt.Sprint(i8))
|
|
|
|
+ return int(in)
|
|
} else {
|
|
} else {
|
|
return defaultNum
|
|
return defaultNum
|
|
}
|
|
}
|