in reply to Rounding to a Given Number of Significant Figures Rather Than Decimal Places

Have a look at Does Perl Have A round() function? in the Perl FAQ Number 4 perlfaq4

E.G. The POSIX module (part of the standard Perl distribution) implements ceil(), floor(), and a number of other mathematical and trigonometric functions.

use POSIX; $ceil = ceil(3.5); # 4 $floor = floor(3.5); # 3

-----
Of all the things I've lost in my life, its my mind I miss the most.
  • Comment on Re: Rounding to a Given Number of Significant Figures Rather Than Decimal Places
  • Download Code