How about:

my $nu = 1.543
$num =~ s/\..*$//;
$num++;


it's not exactly pretty, but it does work...


R


At 11:53 12/09/2002 +0300, Octavian Rasnita wrote:
>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]

Reply via email to