Help for this page

Select Code to Download


  1. or download this
    C:\usr\local\share\PassThru\perl>perl -le "print int(100*'1.13')"
    112
    
    C:\usr\local\share\PassThru\perl>perl -MPOSIX=round -le "print round(1
    +00*'1.13')"
    113
    
  2. or download this
    #### redo, with proper rounding
    $from_api = get_from_api();
    ...
    print "string from_api = '$from_api' after text manipulation\n";
    $from_api = round($from_api);
    print "good rounding = ", $from_api, "cents\n";
    
  3. or download this
    use warnings;
    use strict;
    ...
    }
    
    done_testing;