fork(1) download
  1. <?php
  2. echo round5cents(4.68) . "\n";
  3. echo round5cents(5.22) . "\n";
  4. echo round5cents(7.46) . "\n";
  5.  
  6. function round5cents($value) {
  7. return round($value / 0.05, 0) * 0.05;
  8. }
  9.  
  10. //https://pt.stackoverflow.com/q/115577/101
Success #stdin #stdout 0.02s 24180KB
stdin
Standard input is empty
stdout
4.7
5.2
7.45