On Dec 20, 2001 at 06:53 +0200, Fax Master took the soap box and proclaimed:
: Hi!
: 
: Help please format output string:
: $t=10/6;
: Print $t;  (1.666666667)

What sort of format do you want?  I'll guess you would like some sort
of precision.  "I want to numbers after the decimal point."

Use printf(), like this:

  printf "%.2f", $t;

This says, I have a floating point number that should only display 2
digits after the decimal point.

Read more in perldoc printf (and perldoc sprintf, for the formatting options).


  Casey West

-- 
"Louis Pasteur's theory of germs is ridiculous fiction".
 -- Pierre Pachet, Professor of Physiology at Toulouse, 1872

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

Reply via email to