Help for this page

Select Code to Download


  1. or download this
    my @data = qw/ 1 1.01 2.49 3.48999 3.5001 /;
    printf "%s => %0.2f\n", $_, $_ for @data;
    
  2. or download this
    my @data = qw/ 1 1.01 2.49 3.48999 3.5001 90 90.0 90.00 90.01 /;
    #use %d instead of %0.0f if you don't want rounding
    printf "%s => %0.0f\n", $_, $_ for @data;