diff --git a/utils/typeconv.go b/utils/typeconv.go index 2136d3fc..3529a93b 100644 --- a/utils/typeconv.go +++ b/utils/typeconv.go @@ -5,6 +5,7 @@ import ( "encoding/json" "errors" "fmt" + "math" "net/url" "reflect" "strconv" @@ -276,6 +277,10 @@ func Int2Str(value int) string { return strconv.Itoa(value) } +func Float64TwoInt64(data float64) int64 { + return int64(math.Round(data)) +} + // timestamp is in second func Timestamp2Str(timestamp int64) string { return Time2Str(Timestamp2Time(timestamp))