代潇瑞博客

incrByFloat 命令/方法/函数

Increment the key with floating point precision.

自增一个浮点型的数值。


Parameters

key

value: (float) value that will be added to the key


Return value

FLOAT the new value


Examples

$redis->incrByFloat('key1', 1.5); /* key1 didn't exist, so it will now be 1.5 */

$redis->incrByFloat('key1', 1.5); /* 3 */

$redis->incrByFloat('key1', -1.5); /* 1.5 */

$redis->incrByFloat('key1', 2.5); /* 3.5 */

【相关命令】

触屏版 | 电脑版

Copyright © 2013 代潇瑞博客手机版

QQ: 446673330

粤ICP备13071969号-1