Golang strconv.ParseFloat() function example
package strconv
Golang strconv.ParseFloat() function usage example
package main
import (
"fmt"
"strconv"
)
func main() {
s := "123.010"
f, err := strconv.ParseFloat(s, 10)
if err != nil {
fmt.Println(err)
}
fmt.Println(f)
}
Reference :
Advertisement
Something interesting
Tutorials
+6.1k Golang : Trim everything onward after a word
+5.2k Linux/Unix : Commands that you need to be careful about
+15.1k Golang : Check if a string contains multiple sub-strings in []string?
+18.9k Golang : How to get struct tag and use field name to retrieve data?
+4.4k PHP : Fix Call to undefined function curl_init() error
+5.2k Golang : How to get capacity of a slice or array?
+7.9k Golang : Generate random Chinese, Japanese, Korean and other runes
+12.4k Golang : Activate web camera and broadcast out base64 encoded images
+3.9k Unix/Linux : How to pipe/save output of a command to file?
+10.5k Golang : Sort and reverse sort a slice of runes
+8.6k Javascript : Read/parse JSON data from HTTP response