Is there some way to really round a number to a given number of digits
after the point?
For example (1 digit):
        12.3 --> 12.3
        12.34 --> 12.3
        12.35 --> 12.4
        12.349 --> 12.3

sprintf doesn't seem to work:

        $ perl -e '$a=11.45; $a=sprintf("%.1f", $a); print $a;'
        11.4

--
Jorge Almeida

--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
<http://learn.perl.org/> <http://learn.perl.org/first-response>


Reply via email to