Home > Article > Backend Development > What should I do if the php round function is not accurate?
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".
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!