Your skill will accomplish what the force of many cannot |
|
PerlMonks |
Re: How do I round a number?by jlistf (Monk) |
on Jul 26, 2000 at 00:15 UTC ( [id://24341]=note: print w/replies, xml ) | Need Help?? |
POSIX probably has an appropriate routine that'll do just that. You could also try using sprintf with the appropriate %0.2f (or whatever precision you're looking for). finally (TMTOWTDI), you could use the int keyword to truncate it, which might be more effective. for example, to generate dice rolls:
In Section
Seekers of Perl Wisdom
|
|