RE: Rounding a number

2002-09-13 Thread Bob Showalter
> -Original Message- > From: Mike Craig [mailto:[EMAIL PROTECTED]] > Sent: Thursday, September 12, 2002 10:02 PM > To: [EMAIL PROTECTED] > Subject: RE: Rounding a number > > > Hi, > > Unless I have missed exactly what you need, this should work >

RE: Rounding a number

2002-09-12 Thread Mike Craig
D] Subject: RE: Rounding a number > -Original Message- > From: Octavian Rasnita [mailto:[EMAIL PROTECTED]] > Sent: Thursday, September 12, 2002 4:54 AM > To: [EMAIL PROTECTED] > Subject: Rounding a number > > > Hi all, > > I would like to round a number but

RE: Rounding a number

2002-09-12 Thread Kipp, James
woops that won't work :-( does perl have a ceil function? > -Original Message- > From: Kipp, James [mailto:[EMAIL PROTECTED]] > Sent: Thursday, September 12, 2002 11:58 AM > To: 'Octavian Rasnita'; [EMAIL PROTECTED] > Subject: RE: Rounding a number > &g

Re: Rounding a number

2002-09-12 Thread William McKee
Yet another example of how to do rounding; this time using sprintf (I think I grabbed this from a TechRepublic Perl Tip email) ROUNDING NUMBERS USING SPRINTF Perl doesn't have a function specifically for rounding numbers to a specified number of decimal places. However, you can use

RE: Rounding a number

2002-09-12 Thread Kipp, James
do you mean ro round up to the next num, if so: $num = 1.2; $roundup = int($num) +1; > -Original Message- > From: Octavian Rasnita [mailto:[EMAIL PROTECTED]] > Sent: Thursday, September 12, 2002 4:54 AM > To: [EMAIL PROTECTED] > Subject: Rounding a number > > &

RE: Rounding a number

2002-09-12 Thread Bob Showalter
> -Original Message- > From: Octavian Rasnita [mailto:[EMAIL PROTECTED]] > Sent: Thursday, September 12, 2002 4:54 AM > To: [EMAIL PROTECTED] > Subject: Rounding a number > > > Hi all, > > I would like to round a number but to the next integer not

Re: Rounding a number

2002-09-12 Thread Robin Cragg
How about: my $nu = 1.543 $num =~ s/\..*$//; $num++; it's not exactly pretty, but it does work... R At 11:53 12/09/2002 +0300, Octavian Rasnita wrote: >Hi all, > >I would like to round a number but to the next integer not like the int >function does. > >I've tried: > >my $num = 1.33; >$num

Re: Rounding a number

2002-09-12 Thread Christopher G Tantalo
Octavian Rasnita wrote: > Hi all, > > I would like to round a number but to the next integer not like the int > function does. > > I've tried: > > my $num = 1.33; > $num = $num + 0.49; > $num = sprintf "%.0f", $num; > > This works but I am wondering if there is a cleaner and better solution >

Rounding a number

2002-09-12 Thread Octavian Rasnita
Hi all, I would like to round a number but to the next integer not like the int function does. I've tried: my $num = 1.33; $num = $num + 0.49; $num = sprintf "%.0f", $num; This works but I am wondering if there is a cleaner and better solution because there is a small chance not to work fo