MCPcopy Create free account
hub / github.com/code-scan/Goal / Str2Float

Function Str2Float

Gconvert/num.go:43–51  ·  view source on GitHub ↗
(s string)

Source from the content-addressed store, hash-verified

41}
42
43func Str2Float(s string) float32 {
44 ret, err := strconv.ParseFloat(s, 32)
45 if err != nil {
46 log.Println("[!] Str2Float Error: ", err)
47
48 return 0
49 }
50 return float32(ret)
51}
52func Str2Float64(s string) float64 {
53 ret, err := strconv.ParseFloat(s, 64)
54 if err != nil {

Callers 1

TestConvertFunction · 0.92

Calls

no outgoing calls

Tested by 1

TestConvertFunction · 0.74