Predeclared type

Go float64 type

IEEE 754 binary64 floating-point type; 53 bits of significand precision for normal values. Default type of an untyped floating-point constant when a default is needed. Not exact decimal arithmetic. Example output: '2.50'.

Formal Syntax & Structure

go syntaxgo
float64

Working Example

Example Snippetgo
package main
import (  "fmt")
func main() {  var price float64 = 1.25  fmt.Printf("%.2f\n", price*2)}
Go Reference