golang แปลงเป็น int ได้ให้ข้อความ
str := strconv.Itoa(12)
golang การวิเคราะห์ float64
f, err := strconv.ParseFloat("3.1415", 64)
ไปแปลงเป็นจำนวนเต็มที่ข้อความ
s := strconv.Itoa(i)
// also
s := strconv.FormatInt(i, 10)
// and also
s := fmt.Sprintf("%d", i)
golang แปลงข้อความที่จะ int64
s := "97"
n, err := strconv.ParseInt(s, 10, 64)
if err == nil {
fmt.Printf("%d of type %T", n, n)
}
แปลงเป็นข้อความเพื่อน int ได้ golang
var s string
i, err := strconv.Atoi(s)