[95560] in RedHat Linux List

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

Re: Perl

daemon@ATHENA.MIT.EDU (Benjamin de los Angeles Jr.)
Mon Oct 19 11:52:29 1998

Date: Tue, 20 Oct 1998 00:02:49 +0800 (CST)
From: "Benjamin de los Angeles Jr." <bench@boracay.surfshop.net.ph>
To: redhat-list@redhat.com
In-Reply-To: <362B4840.B7CEAE54@kramer.ne.mediaone.net>
Resent-From: redhat-list@redhat.com
Reply-To: redhat-list@redhat.com


Thanks, very nice solution: int($num+.5), that's what I'm looking for.

On Mon, 19 Oct 1998, David Kramer wrote:

> 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);


-- 
  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