content/commands/hincrbyfloat.md
Increment the specified field of a hash stored at key, and representing a
floating point number, by the specified increment. If the increment value
is negative, the result is to have the hash field value decremented instead of incremented.
If the field does not exist, it is set to 0 before performing the operation.
An error is returned if one of the following conditions occur:
The exact behavior of this command is identical to the one of the [INCRBYFLOAT]({{< relref "/commands/incrbyfloat" >}})
command, please refer to the documentation of [INCRBYFLOAT]({{< relref "/commands/incrbyfloat" >}}) for further
information.
{{% redis-cli %}} HSET mykey field 10.50 HINCRBYFLOAT mykey field 0.1 HINCRBYFLOAT mykey field -5 HSET mykey field 5.0e3 HINCRBYFLOAT mykey field 2.0e2 {{% /redis-cli %}}
The command is always propagated in the replication link and the Append Only
File as a [HSET]({{< relref "/commands/hset" >}}) operation, so that differences in the underlying floating point
math implementation will not be sources of inconsistency.
| Redis Software | Redis Cloud | <span style="min-width: 9em; display: table-cell">Notes</span> | |:----------------------|:-----------------|:------| | <span title="Supported">✅ Standard</span> <span title="Supported"><nobr>✅ Active-Active</nobr></span> | <span title="Supported">✅ Standard</span> <span title="Supported"><nobr>✅ Active-Active</nobr></span> | |
{{< multitabs id="hincrbyfloat-return-info" tab1="RESP2" tab2="RESP3" >}}
Bulk string reply: the value of the field after the increment operation.
-tab-sep-
Bulk string reply: The value of the field after the increment operation.
{{< /multitabs >}}