diff --git a/utils/utils.go b/utils/utils.go index d449559..e3bed07 100644 --- a/utils/utils.go +++ b/utils/utils.go @@ -5,6 +5,7 @@ import ( "fmt" "github.com/lianggx6/goutf16" "io" + "math" "math/rand" "net/http" "os" @@ -386,4 +387,10 @@ func FileExist(file string) bool { } return true +} + +func Round(num float64) int { + num += 0.5 + num = math.Floor(num) + return int(num) } \ No newline at end of file