perldoc -f sprintf
$archives_needed = sprintf "%.0f", $archives_needed;
Cheers,
Kevin
On Fri, May 18, 2001 at 09:05:37AM -0400, Craig Moynes/Markham/IBM
([EMAIL PROTECTED]) spew-ed forth:
> I looked through my book (perl nutshell) and PP has not arrived yet, so I
> will ask here.
>
> I have an number that needs to be rounded to the nearest whole number.
> This is my solution:
>
>
> if ( $archives_needed =~ /\.\d+/ )
> {
> ($remainder = $archives_needed) =~ s/\d+(\.
> \d+)/$1/;
> $archives_needed += $remainder;
> $archives_needed =~ s/\.\d+//;
> }
>
> Is there an easier way (or more efficent). This is more a curiosity than
> anything else.
>
> Thanks perl junkies,
>
> -----------------------------------------
> Craig Moynes
> [EMAIL PROTECTED]
>
>
--
[Writing CGI Applications with Perl - http://perlcgi-book.com]
"BASIC is the Computer Science equivalent of `Scientific Creationism'."
-- BSD fortune file