Help for this page

Select Code to Download


  1. or download this
    $string = int( ($number * 100) + 5 ) / 100;
    
  2. or download this
    my $dec = 100;  # Change as appropriate to give you the number
                    # of decimal places you want
    
    int( ($number * $dec) +
      int($number * $dec) % 2 ? 0.5 * $dec : 0) / $dec