I have a double value of 2.6647 which I am trying to round mathematically correct to 2 decimal places.
I am expecting a return value of 2.67.
7 (the last decimal place) should round 4 (the second-last decimal place) up to 5, 5 should round 6 (the third-last decimal place) up to 7.
$value = 2.6647;
echo round( $value, 2, PHP_ROUND_HALF_UP );
But instead I receive 2.66. Why is this happening?
PHP Version is 5.3.28.