Can some one explain if this can be fixed using php.ini settings ?
echo "round 20.545 -".round(20.545, 2)."<br>";
echo "round 20.555 -".round(20.555, 2)."<br>";
echo "number_for mat 20.545 -".number_format (20.545, 2, ',',
'.')."<br>";
echo "number_for mat 20.555 -".number_format (20.555, 2, ',',
'.')."<br>";
PHP Version 4.3.0 / FreeBSD
round 20.545 -20.55
round 20.555 -20.56
number_format 20.545 -20,55
number_format 20.555 -20,55
PHP Version 4.4.4 / CENTOS
round 20.545 -20.55
round 20.555 -20.55
number_format 20.545 -20,55
number_format 20.555 -20,55
PHP Version 5.1.4 / Windows NT
round 20.545 -20.55
round 20.555 -20.56
number_format 20.545 -20,55
number_format 20.555 -20,56
I know that the round always goes for the odd but this is not
consistence with the SO running PHP
Thanks
echo "round 20.545 -".round(20.545, 2)."<br>";
echo "round 20.555 -".round(20.555, 2)."<br>";
echo "number_for mat 20.545 -".number_format (20.545, 2, ',',
'.')."<br>";
echo "number_for mat 20.555 -".number_format (20.555, 2, ',',
'.')."<br>";
PHP Version 4.3.0 / FreeBSD
round 20.545 -20.55
round 20.555 -20.56
number_format 20.545 -20,55
number_format 20.555 -20,55
PHP Version 4.4.4 / CENTOS
round 20.545 -20.55
round 20.555 -20.55
number_format 20.545 -20,55
number_format 20.555 -20,55
PHP Version 5.1.4 / Windows NT
round 20.545 -20.55
round 20.555 -20.56
number_format 20.545 -20,55
number_format 20.555 -20,56
I know that the round always goes for the odd but this is not
consistence with the SO running PHP
Thanks
Comment