w3resource

Redis String: INCRBYFLOAT

INCRBYFLOAT key increment

Redis INCRBYFLOAT command is used to increments the string representing a floating point number stored at key by the specified increment. If the key does not exist, it is set to 0 before performing the operation. If the key contains a value of the wrong type or current key content or the specified increment are not parsable as floating point number, then an error is returned.

Syntax:

INCRBYFLOAT KEY_NAME INCR_AMOUNT

Available since

2.6.0.

Return Value

String reply, the value of key after the increment.

Return Value Type

String

Example: Redis INCRBYFLOAT

redis 127.0.0.1:6379> SET visitors 1000.20
OK
redis 127.0.0.1:6379> INCRBYFLOAT visitors .50
1000.70
redis 127.0.0.1:6379> GET visitors
1000.70

Previous: INCRBY
Next: DECR



Follow us on Facebook and Twitter for latest update.