Floor in Go

Posted by GoDoc
Public (Editable by Users)

Floor returns the greatest integer value less than or equal to x.

Go
Edit
package main

import (
	"fmt"
	"math"
)

func main() {
	c := math.Floor(1.51)
	fmt.Printf("%.1f", c)
}