golang परिवर्तित पूर्णांक स्ट्रिंग के लिए
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)