There is no decrByFloat method in the php redis extension, right?

WBOY
Release: 2016-08-18 09:16:26
Original
1418 people have browsed it

A question involving a user's balance, the format is 10.00, with two decimal places.
The incrByFloat method is used when increasing
But it doesn’t work when decreasing. Can we only read it first, do subtraction, and then set it?

Reply content:

A question involving a user's balance, the format is 10.00, with two decimal places.
The incrByFloat method is used when increasing
But it doesn’t work when decreasing. Can we only read it first, do subtraction, and then set it?

incrByFloat($key, -10.00);

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!