mirror of
https://github.com/jefferyjob/go-easy-utils.git
synced 2025-09-26 19:11:12 +08:00
11 lines
156 B
Go
11 lines
156 B
Go
package mathx
|
|
|
|
import (
|
|
"math"
|
|
)
|
|
|
|
// Round 对float数据四舍五入
|
|
func Round[T float32 | float64](num T) int {
|
|
return int(math.Round(float64(num)))
|
|
}
|