From fc0825a7fadff896f774a4d09f3b50bf1f02b575 Mon Sep 17 00:00:00 2001 From: Tobie Morgan Hitchcock Date: Wed, 6 Dec 2017 13:21:49 +0000 Subject: [PATCH] Make sure that any non floats are converted to floats --- db/fetch.go | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/db/fetch.go b/db/fetch.go index b8d8ec52..bef98918 100644 --- a/db/fetch.go +++ b/db/fetch.go @@ -40,6 +40,24 @@ func (e *executor) fetch(ctx context.Context, val interface{}, doc *data.Doc) (o return val, nil case *sql.Value: return val.ID, nil + case int: + return float64(val), nil + case int8: + return float64(val), nil + case int16: + return float64(val), nil + case int32: + return float64(val), nil + case int64: + return float64(val), nil + case uint: + return float64(val), nil + case uint16: + return float64(val), nil + case uint32: + return float64(val), nil + case uint64: + return float64(val), nil case []byte: return string(val), nil case []interface{}: