On Wed, 3 Oct 2001, Sofia wrote:

> I am doing some division in my perl program but the
> result of the division is a number with many decimal
> places (12.34567899) How can I truncate the number to
> just two decimal places and round up or down if
> necessary?  Is there a module that will let me specify
> the number of decimal places I want for my results?

This is a question that gets asked so often that it has become an official
Frequently Asked Question, so rather than repeat what is found in the Perl
FAQ, you can read it for yourself:

perldoc -q round

-- Brett
                                          http://www.chapelperilous.net/
------------------------------------------------------------------------
QOTD:
        If you're looking for trouble, I can offer you a wide selection.


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

Reply via email to