in reply to Rounding over numbers

Here's one way to do it, with help from the Number::Format module.
#!/usr/bin/env perl use strict; use warnings; use Number::Format; while(<DATA>) { chomp $_; my $x = new Number::Format; my $formatted = $x->format_number($_, 1, 1); $formatted = sprintf("%.2f", $formatted); print "$_ -> $formatted\n"; } exit; __DATA__ 1.24 13.25 2.90 2.99 2.92 14
Output:
1.24 -> 1.20 13.25 -> 13.30 2.90 -> 2.90 2.99 -> 3.00 2.92 -> 2.90 14 -> 14.00