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 [download]
Update: Better sprintf, as has been pointed out
-- David Serrano