sub round_to { my ($value, $places) = @_; my $exp = 10 ** $places; return int(($value * $exp * 10 + 5) / 10) / $exp; } print round_to(12678/1000, 1),$/;
In reply to Re: Dividing and format
by tadman
in thread Dividing and format
by hotshot
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |