You want printf:
while (<DATA>) { printf "%1.2f\n", $_; } __DATA__ 86902 .50 2. 165.0 0.666666666
Update: Better sprintf, as has been pointed out
--
David Serrano
In reply to Re: How to give format to numbers?
by Hue-Bond
in thread How to give format to numbers?
by Anonymous Monk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |