Skip to content
This repository has been archived by the owner on May 14, 2024. It is now read-only.

INCRBYFLOAT

Josh Baker edited this page Oct 10, 2016 · 7 revisions

INCRBYFLOAT key increment

Increment the string representing a floating point number stored at key by the specified increment. By using a negative increment value, the result is that the value stored at the key is decremented (by the obvious properties of addition). If the key does not exist, it is set to 0 before performing the operation. An error is returned if one of the following conditions occur:

Return value

Bulk string reply: the value of key after the increment.

Examples

redis> SET mykey 10.50
OK
redis> INCRBYFLOAT mykey 0.1
"10.6"
redis> INCRBYFLOAT mykey -5
"5.6"
redis> SET mykey 5.0e3
OK
redis> INCRBYFLOAT mykey 2.0e2
"5200"
Clone this wiki locally