Skip to content

Instantly share code, notes, and snippets.

@JensRantil

JensRantil/round.go

Forked from DavidVaini/round.go
Last active Aug 29, 2015
Embed
What would you like to do?
package main
import (
"log"
"math"
)
func Round(val float64) float64 {
return math.Floor(val + 0.5)
}
func main() {
log.Println(Round(123.555555))
log.Println(Round(123.558))
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.