Commit e9419e37db0c162061220eea2867a17550ce5ca8
1 parent
e95e683624
Exists in
master
string to float
Showing
1 changed file
with
6 additions
and
0 deletions
Show diff stats
int_util.go
... | ... | @@ -27,6 +27,12 @@ func StringToInt64(s string) int64 { |
27 | 27 | return i |
28 | 28 | } |
29 | 29 | |
30 | +// StringToFloat64 ... | |
31 | +func StringToFloat64(s string) float64 { | |
32 | + f, _ := strconv.ParseFloat(s, 64) | |
33 | + return f | |
34 | +} | |
35 | + | |
30 | 36 | // Int64ToString ... |
31 | 37 | func Int64ToString(i int64) string { |
32 | 38 | return fmt.Sprintf("%d", i) | ... | ... |