How is it not correctly rounding? It seems that it would consistently work (positive
numbers only, of course, and that fix was already discussed). Is there another
instance where it would not work?
Adam Carson
MIS Department
Berkeley County, SC
>>> "Brett W. McCoy" <[EMAIL PROTECTED]> 08/09/01 09:38AM >>>
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.
-- 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]
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]