Quick actions

cmd+k|ctrl+k

Navigation

Languages

Basic types / Floating-point numbers / Essential Go

Snippet info

Language

Go

Visibility

public

Author

kkowalczyk

Created

2019-03-26T10:02:38Z

Updated

2019-03-26T10:02:38Z

// :glot,
package main

import (
	"fmt"
	"log"
	"strconv"
)

func main() {
	s := "1.2341"
	f64, err := strconv.ParseFloat(s, 64)
	if err != nil {
		log.Fatalf("strconv.ParseFloat() failed with '%s'\n", err)
	}
	fmt.Printf("f64: %f\n", f64)
}
INFO