Round returns the nearest integer, rounding half away from zero.
package main import ( "fmt" "math" ) func main() { p := math.Round(10.5) fmt.Printf("%.1f\n", p) n := math.Round(-10.5) fmt.Printf("%.1f\n", n) }