sub RoundUp { $float=$_[0]; ... ..check that your input is valid here.. ... my $rounded_number=$float; if($float==int($float)){ }elsif($float>0){ $rounded_number=int($float+1); ################################### ## and optionally, depending how ## ## you want to define ceil() on ## ## a number less than 0.. ## }elsif($float<0){ $rounded_number=int($float-1); } ################################### return rounded_number; }