[95534] in RedHat Linux List

home help back first fref pref prev next nref lref last post

Re: Perl

daemon@ATHENA.MIT.EDU (David Kramer)
Mon Oct 19 10:13:05 1998

Date: Mon, 19 Oct 1998 10:10:08 -0400
From: David Kramer <david@kramer.ne.mediaone.net>
To: redhat-list@redhat.com
Resent-From: redhat-list@redhat.com
Reply-To: redhat-list@redhat.com

Benjamin de los Angeles Jr. wrote:
> 
> How do I round off a decimal number?

To truncate the decimal portion, use int() or POSIX::floor().

To find the next highest integer (round up) use POSIX:ceil().

To find the closest integer, use int($num+.5);
-------------------------------------------------------------------
DDDD   David Kramer                    david@kramer.ne.mediaone.net
DK KD                                  http://start.at/david.kramer
DKK D  
DK KD  All those who believe in psychokinesis raise my hand.
DDDD


-- 
  PLEASE read the Red Hat FAQ, Tips, Errata and the MAILING LIST ARCHIVES!
		http://www.redhat.com http://archive.redhat.com
         To unsubscribe: mail redhat-list-request@redhat.com with 
                       "unsubscribe" as the Subject.


home help back first fref pref prev next nref lref last post