Easy Tutorial
❮ Keys Keys Redis Data Types ❯

Redis Hincrbyfloat Command

Redis Hashes

The Redis Hincrbyfloat command is used to add a specified floating-point increment to the field value in a hash table.

If the specified field does not exist, the field's value is initialized to 0 before the command is executed.

Syntax

The basic syntax for the redis Hincrbyfloat command is as follows:

HINCRBYFLOAT key field increment

Available Versions

= 2.6.0

Return Value

The value of the field in the hash table after the Hincrbyfloat command is executed.

Example

redis> HSET mykey field 10.50
(integer) 1
redis> HINCRBYFLOAT mykey field 0.1
"10.6"
redis> HINCRBYFLOAT mykey field -5
"5.6"
redis> HSET mykey field 5.0e3
(integer) 0
redis> HINCRBYFLOAT mykey field 2.0e2
"5200"
redis>

Redis Hashes

❮ Keys Keys Redis Data Types ❯