Skip to content

Commit

Permalink
Merge pull request #59 from RedisTimeSeries/string-->-float
Browse files Browse the repository at this point in the history
fix for timeseries which return double as string
  • Loading branch information
filipecosta90 authored Apr 30, 2020
2 parents 355df6b + e331317 commit 60a81d2
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions reply_parser.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ package redis_timeseries_go
import (
"errors"
"fmt"
"strconv"
"github.com/gomodule/redigo/redis"
)

Expand Down Expand Up @@ -112,11 +113,15 @@ func ParseDataPoint(rawDataPoint interface{}) (dataPoint *DataPoint, err error)
if err != nil {
return
}
value, err := redis.Float64(iValues[1], nil)
value, err := redis.String(iValues[1], nil)
if err != nil {
return
}
dataPoint = NewDataPoint(timestamp, value)
float, err := strconv.ParseFloat(value, 64)
if err != nil {
return
}
dataPoint = NewDataPoint(timestamp, float)
return
}

Expand Down

0 comments on commit 60a81d2

Please sign in to comment.