Home  >  Article  >  Backend Development  >  What should I do if the php round function is not accurate?

What should I do if the php round function is not accurate?

藏色散人
藏色散人Original
2021-06-02 10:17:393277browse

The solution to the inaccurate php round function: first find and open the php.ini configuration file; then set the content to "serialize_precision=-1".

What should I do if the php round function is not accurate?

The operating environment of this article: windows7 system, PHP7.1 version, DELL G3 computer

Solution to the problem of inaccurate accuracy after using round in php7.1 Solution

There is a problem with accuracy after using round(xx, 2) in the project, and the result is not rounded to 2 decimal places.

Googled for a long time and finally found a solution.

Set serialize_precision = -1 in php.ini That’s it

Recommended learning: "PHP Video Tutorial"

The above is the detailed content of What should I do if the php round function is not accurate?. For more information, please follow other related articles on the PHP Chinese website!

Statement:
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