Answers for "go float64 to int"

Go
2

golang convert string to int64

s := "97"
n, err := strconv.ParseInt(s, 10, 64)
if err == nil {
    fmt.Printf("%d of type %T", n, n)
}
Posted by: Guest on May-09-2020
0

go convert a string (with decimals) to a floating point number.

f, err := strconv.ParseFloat(s, 64)
Posted by: Guest on February-24-2021

Browse Popular Code Answers by Language