It was Wednesday, July 30, 2003 when Dan Muey took the soap box, saying:
: 
: If I have a number like so:
: 5.8592675
: 
: I need to make it a x.xx instead of x.xxxxxxxxx and I need to round it up to the 
next hundredth like so : 5.86
: 
: I can't seem to remember the round type functions name and am always screwy with 
sprintf.
: 
: What combo of sprintf() and round() or whatever would do what I'm trying to 
accomplish?

sprintf will do a fair job of rounding for you.  See the following
document:

  perldoc -q round

But basically, you could do:

  my $rounded = sprintf '%.2f', $number;

  Casey West

-- 
Shooting yourself in the foot with SmallTalk
You daydream repeatedly about shooting yourself in the foot.


-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to