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
+17.6k Convert JSON to CSV in Golang
+18.4k Golang : Example for RSA package functions
+20.3k Golang : Check if os.Stdin input data is piped or from terminal
+17k Golang : Covert map/slice/array to JSON or XML format
+7.4k Golang : Create zip/ePub file without compression(use Store algorithm)
+13.9k Golang : How to determine if a year is leap year?
+9.9k Golang : Turn string or text file into slice example
+9.9k Golang : Ordinal and Ordinalize a given number to the English ordinal numeral
+4.6k JavaScript : Rounding number to decimal formats to display currency
+6.9k Golang : Calculate BMI and risk category
+7.8k Golang : Reverse a string with unicode