I would like to solve rounding mechanism by using php4,5.2 and below (not 5.3) Currently I am doing 0.05 rounding, something like this page:
http://www.bnm.gov.my/in
Expanding a little on @xtofl to allow for more precise steps (not technically required for this question)
$step = 0.0005; $multiplicand = floor($value / $step); $rest = fmod($value, $step); $value = $step * $multiplicand; if ($rest > $step / 2) { $value += $step; }