Have to round the number in php. I have tried like below,
round(12.4569,2);
it will return 12.46. its OK.
But, round(12.4003,2);
the output is 12.4
But need the output 12.40
suggestion please...
Have to round the number in php. I have tried like below,
round(12.4569,2);
it will return 12.46. its OK.
But, round(12.4003,2);
the output is 12.4
But need the output 12.40
suggestion please...
Use number_format :
number_format((float)$number, 2, '.', '');