I found a very strange problem, the problem is the ROUND method in PHP and Javascript, the calculation results do not match !?
See the following example:
Php
echo round(175.5);
echo round(-175.5);
Javascript
console.log(Math.round(175.5));
console.log(Math.round(-175.5));
Does anyone know why? and how to make Javascript and PHP the same results?
source
share