Help for this page

Select Code to Download


  1. or download this
    @num = (6, 5.3, 8.5, 9.5000000001, 3.84, 4.51);
    foreach $num (@num) {
    ...
       $new = sprintf "%.0f\n",$num;
       print qq{new: $new};
    }
    
  2. or download this
    original: 6
    new: 6
    ...
    new: 4
    original: 4.51
    new: 5