in reply to How to round and keep floating digits
You want printf or sprintf:
my @number = qw(3 3.555 3.222334 3.4 1 0); for my $float(@number) { $float = nearest(.001, $float); printf "%.3f\n", $float; } [download]
After Compline,Zaxo