my @number = qw(3 3.555 3.222334 3.4 1 0); for my $float(@number) { $float = nearest(.001, $float); printf "%.3f\n", $float; }
After Compline,
Zaxo
In reply to Re: How to round and keep floating digits
by Zaxo
in thread How to round and keep floating digits
by juo
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |