function num($amount) {
return max( 100 * floor($amount / 100), 100);
}
for($i = 0; $i < 500; $i += rand(0,90)) {
printf("%3d -> %3d\n", $i, num($i));
}
0 -> 100
2 -> 100
57 -> 100
105 -> 100
118 -> 100
166 -> 100
249 -> 200
254 -> 200
295 -> 200
307 -> 300
315 -> 300
349 -> 300
403 -> 400
437 -> 400
480 -> 400
488 -> 400