int64 to string golang code example
Example 1: golang convert int to string
str := strconv.Itoa(12)
Example 2: golang uint64 to string
package main
import (
"fmt"
"strconv"
)
func main() {
var myNumber uint64
myNumber = 18446744073709551615
str := strconv.FormatUint(myNumber, 10)
fmt.Println("The number is: " + str)
}
Example 3: 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)
}
Example 4: int to int64 golang
var i int = 32
j := int64(i)