QA

 <  Day Day Up  >  

Q&A

Q1:

The output of the Interest program looks sloppy . How do I control how many digits are displayed?

A1:

The easiest way to control the number of decimal digits is to use the printf function, which is covered in Hour 9, "More Functions and Operators."

Q2:

Does Perl have a function for rounding?

A2:

The printf function usually does what you want for rounding when displaying numbers . If you really need the round function, check out the POSIX module, which has this function and many more.

Q3:

How large (or small) of a number will Perl let me manipulate?

A3:
 <  Day Day Up  >  


SAMS Teach Yourself Perl in 24 Hours
Sams Teach Yourself Perl in 24 Hours (3rd Edition)
ISBN: 0672327937
EAN: 2147483647
Year: 2005
Pages: 241

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net