diff --git a/utils/typeconv.go b/utils/typeconv.go index 51d75ec0..5acea05d 100644 --- a/utils/typeconv.go +++ b/utils/typeconv.go @@ -538,3 +538,7 @@ func IntSlice2Int64(intList []int) (outList []int64) { func Int2Float64(i int) (f float64) { return Str2Float64(Int64ToStr(int64(i))) } + +func Float32ToInt(f float32) (i int) { + return int(Str2Int64(Float64ToStr(math.Round(float64(f))))) +}