From c91164bc93efeb03bb458b9fb175e1f93a911152 Mon Sep 17 00:00:00 2001 From: Tobie Morgan Hitchcock Date: Mon, 20 Aug 2018 08:54:23 +0100 Subject: [PATCH] Ensure all number types are converted to floats --- db/fetch.go | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/db/fetch.go b/db/fetch.go index 7822b595..301bef78 100644 --- a/db/fetch.go +++ b/db/fetch.go @@ -46,8 +46,24 @@ func (e *executor) fetch(ctx context.Context, val interface{}, doc *data.Doc) (o return val.VA, 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 float32: + return float64(val), nil case float64: return float64(val), nil case []interface{}: