woops that won't work :-( does perl have a ceil function? > -----Original Message----- > From: Kipp, James [mailto:[EMAIL PROTECTED]] > Sent: Thursday, September 12, 2002 11:58 AM > To: 'Octavian Rasnita'; [EMAIL PROTECTED] > Subject: RE: Rounding a number > > > do you mean ro round up to the next num, if so: > $num = 1.2; > $roundup = int($num) +1; > > > -----Original Message----- > > From: Octavian Rasnita [mailto:[EMAIL PROTECTED]] > > Sent: Thursday, September 12, 2002 4:54 AM > > To: [EMAIL PROTECTED] > > Subject: Rounding a number > > > > > > Hi all, > > > > I would like to round a number but to the next integer not > > like the int > > function does. > > > > I've tried: > > > > my $num = 1.33; > > $num = $num + 0.499999; > > $num = sprintf "%.0f", $num; > > > > This works but I am wondering if there is a cleaner and > > better solution > > because there is a small chance not to work for some numbers. > > > > Thank you. > > > > Teddy's Center: http://teddy.fcc.ro/ > > Mail: [EMAIL PROTECTED] > > > > > > > > -- > > To unsubscribe, e-mail: [EMAIL PROTECTED] > > For additional commands, e-mail: [EMAIL PROTECTED] > > > > > > > -- > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > >
-- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]