Merge pull request #17 from jinty/string-to-flaot

Parse strings to floats
This commit is contained in:
Will Rouesnel 2016-07-30 11:44:17 +10:00 committed by GitHub
commit 382729a166

View File

@ -323,6 +323,13 @@ func dbToFloat64(t interface{}) (float64, bool) {
return math.NaN(), false
}
return result, true
case string:
result, err := strconv.ParseFloat(v, 64)
if err != nil {
log.Println("Could not parse string:", err)
return math.NaN(), false
}
return result, true
case nil:
return math.NaN(), true
default: