MCPcopy Create free account
hub / github.com/cogentcore/core / StringToFloat64

Function StringToFloat64

tensor/string.go:43–48  ·  view source on GitHub ↗

StringToFloat64 converts string value to float64 using strconv, returning 0 if any error

(str string)

Source from the content-addressed store, hash-verified

41// StringToFloat64 converts string value to float64 using strconv,
42// returning 0 if any error
43func StringToFloat64(str string) float64 {
44 if fv, err := strconv.ParseFloat(str, 64); err == nil {
45 return fv
46 }
47 return 0
48}
49
50// Float64ToString converts float64 to string value using strconv, g format
51func Float64ToString(val float64) string {

Callers 7

AddScalarMethod · 0.85
MulScalarMethod · 0.85
FloatMethod · 0.85
Float1DMethod · 0.85
FloatRowCellMethod · 0.85
FloatsMethod · 0.85
RangeMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected