in reply to How to give format to numbers?

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