"Brett W. McCoy" wrote:
> 
> On Thu, 9 Aug 2001, Ken Brakey wrote:
> 
> > > That's BASIC, this is Perl.  Perl's int truncates towards 0 (as the FAQ
> > > mentioned), so adding .5 isn't going to do anything.
> > >
> > > $ perl -e '$num = 12.3; print int($num + .5);'
> > > 12
> >
> > Try it with "12.6" :-)
> 
> Right, but it's still not correctly rounding, and it's not a generic
> solution, whereas using printf or sprintf is.

Yours may be broke, but it always worked for me. :-))
Ken

> 
> -- Brett
>                                    http://www.chapelperilous.net/btfwk/
> ------------------------------------------------------------------------
> He who minds his own business is never unemployed.

-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to