-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

On 2006-12-26 14:00, Dermot Moynihan wrote:
> Let's say that after a calculation I get 4.1200056 and I want to round
> it up to 5.
> When the calculation comes to a number like 4.0 I want it left at 4.

Hi!

You can use the 'ceil'-method:

(4.1).ceil # => 5
(4.7).ceil # => 5
(4.0).ceil # => 4

fyi: there is also the floor method which always returns the lower number:
(4.1).floor # => 4
(4.7).floor # => 4
(4.0).floor # => 4


greetz!
Jeroen
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.5 (MingW32)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iD8DBQFFkR8bH04wF4t7d0oRAsMsAJ4pKs5RXexGLwsCOdnSv/nuHX1cwQCggUKg
GIwygWGnNvhQ0ZLJxFWYOgU=
=0HKe
-----END PGP SIGNATURE-----