 |
PHP: round - Manual - PHP: Hypertext Preprocessor
In case someone will need a "graceful" rounding (that changes it's precision to get a non 0 value) here's a simple function: function gracefulRound($val, $min = 2, $max = 4) { $result = round($val, $min); if ($result == 0 && $min < $max) { return ...
php.net |
 |