fork(8) download
  1. <?php
  2.  
  3. echo round5cents(4.68) . "\n";
  4. echo round5cents(5.22) . "\n";
  5. echo round5cents(7.46) . "\n";
  6.  
  7. function round5cents($value) {
  8. return round($value / 0.05, 0) * 0.05;
  9. }
Success #stdin #stdout 0.01s 52488KB
stdin
Standard input is empty
stdout
4.7
5.2
7.45