limit values after decimal php code example
Example 1: fix to 2 decimal places php
return number_format((float)$number, 2, '.', '');
Example 2: remove decimal php
$var = 252.587254564;
$var = (int)$var; // 252
return number_format((float)$number, 2, '.', '');
$var = 252.587254564;
$var = (int)$var; // 252