INCRBYFLOAT

Redis Developer Course Redis Cloud Service Redis-Gate Server

Increment by the given number(floating point number)

Increment(adding) the value of a key by the given number(floating point number).
If the key does not exist in the database, it is set to 0 before performing the operation, add the given number and return it.
Usage is INCRBYFLOAT key number.

Return value

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

Example

command>incrbyfloat key 15.6
result>15.6
command>incrbyfloat key 3.3
result>18.9


Allow negative integer input

Example

command>incrbyfloat key -25.5
result>-25.5


Syntax

INCRBYFLOAT key increment(floating point number or integer)

  • Available since 2.6.0.
  • Time complexity: O(1)
Related Commands INCR, DECR, INCRBY, DECRBY
Clients for Java Jedis, Lettuce, Redisson
Clients for C Hiredis

To practice the command, click here to run Redis Web Client


<< DECRBY INCRBYFLOAT SETNX >>

Click for a question or to see comments.  Comments :    Viewed :

Email 답글이 올라오면 이메일로 알려드리겠습니다.