Not sure if this is normal but personally, I think it is not giving me the right result. Lets look at this example
$a = 3.32475;
$b = round($a,2,PHP_ROUND_HALF_UP);
I was expecting 3.33 but instead I get 3.32. Am I missing something here? Is the rounding function only literally uses the 3rd decimal point value instead of the whole value, and then rounding it up?
What I was expecting was something like this:-
- 3.32475
- 3.3248
- 3.325
- 3.33
Am I doing something wrong here? is there a better way for me to get an accurate rounding base on the whole value rather than the 3rd decimal point?
Thanks.