Help for this page

Select Code to Download


  1. or download this
    sub a{$_=int$_[0]*10**$_[1];s;(.{$_[1]})$;\.$1;;return$_};
    
  2. or download this
    my @a = ("1.10", "2.22");
    print STDOUT &a($_, 1) for @a;
    
    sub a{$_=int$_[0]*10**$_[1];s;(.{$_[1]})$;\.$1;;return$_};
    
  3. or download this
    sub a{$_=int$_[0]*10**$_[1]+.5;s;(.{$_[1]})$;\.$1;;chop if substr($_,-
    +1)eq'.';return$_};
    
  4. or download this
    value|precision     sprintf   Incognito   Albannach       jeffa      r
    +ob_au
     '123.45678'|3:     123.457     123.456     123.456         123     12
    +3.457
    ...
            '3.'|0:           3           3           3           3       
    +    3
          '1000'|5:  1000.00000  1000.00000  1000.00000       01000  1000.
    +00000
         '12.56'|0:          13          12          12          12       
    +   13