round off php number code example
Example 1: fix to 2 decimal places php
return number_format((float)$number, 2, '.', '');
Example 2: php round to whole number
$int = 8.998988776636;
round($int) //Will always be 9
$int = 8.344473773737377474;
round($int) //will always be 8