From e9419e37db0c162061220eea2867a17550ce5ca8 Mon Sep 17 00:00:00 2001 From: "marko.tikvic" Date: Tue, 21 May 2019 15:05:47 +0200 Subject: [PATCH] string to float --- int_util.go | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/int_util.go b/int_util.go index 8b32a7d..7b5b733 100644 --- a/int_util.go +++ b/int_util.go @@ -27,6 +27,12 @@ func StringToInt64(s string) int64 { return i } +// StringToFloat64 ... +func StringToFloat64(s string) float64 { + f, _ := strconv.ParseFloat(s, 64) + return f +} + // Int64ToString ... func Int64ToString(i int64) string { return fmt.Sprintf("%d", i) -- 1.8.1.2