niksmac
niksmac

Reputation: 2782

Redis ReplyError(string) when passing floating point number

When I am passing a floating point number -3.074 to hincrby I am getting this error.

ReplyError: ERR value is not an integer or out of range

Code

console.log(typeof sizeInMB, sizeInMB) // number -3.074
redis.hincrby('MYHASH', 'storage', sizeInMB) // throws above error 

I am very new to redis, forgive me if I missed something obvious.

Upvotes: 0

Views: 386

Answers (1)

niksmac
niksmac

Reputation: 2782

Got it working by changing hincrby to hincrbyfloat

Upvotes: 1

Related Questions