Re: printf question

2002-07-01 Thread Jeff 'japhy' Pinyan
On Jul 1, Jeff 'japhy' Pinyan said: >On Jul 1, Ned Cunningham said: > >>Can anyone tell me how to print the following data so that it rounds up >>even though it shouldn't > >Use the POSIX::ceil() function, instead of some crufty solution. > > use POSIX 'ceil'; > printf WRFILE "%11.2f", ceil

Re: printf question

2002-07-01 Thread Jeff 'japhy' Pinyan
On Jul 1, Ned Cunningham said: >Can anyone tell me how to print the following data so that it rounds up >even though it shouldn't Use the POSIX::ceil() function, instead of some crufty solution. use POSIX 'ceil'; printf WRFILE "%11.2f", ceil($data); -- Jeff "japhy" Pinyan [EMAIL

RE: printf question

2002-07-01 Thread Timothy Johnson
You could always try adding .999 to the value before sprintf()ing it... -Original Message- From: Ned Cunningham [mailto:[EMAIL PROTECTED]] Sent: Monday, July 01, 2002 11:32 AM To: '[EMAIL PROTECTED]' Subject: printf question Hi, Can anyone tell me how to print the followi

Re: printf question

2002-07-01 Thread Felix Geerinckx
on Mon, 01 Jul 2002 18:32:27 GMT, Ned Cunningham wrote: > Can anyone tell me how to print the following data so that it rounds > up even though it shouldn't > $data = "3.424"; > [...] > I need it to round up even if it is only .001 ? use strict; use POSIX qw(ceil); sub rou

RE: printf question

2002-07-01 Thread Ned Cunningham
EMAIL PROTECTED]' Subject: RE: printf question correction on my 4th line. $data = sprintf ("%11.2f", $data + (scalar($data =~ /[1-9]$/) && 0.005) ); > -Original Message- > Fr

RE: printf question

2002-07-01 Thread Nikola Janceski
correction on my 4th line. $data = sprintf ("%11.2f", $data + (scalar($data =~ /[1-9]$/) && 0.005) ); > -Original Message- > From: Nikola Janceski [mailto:[EMAIL PROTECTED]] > Sent: Monday, July 01, 2002 2:55 PM > To: 'Ned Cunningham'; '[EMA

RE: printf question

2002-07-01 Thread Nikola Janceski
ssage- > From: Ned Cunningham [mailto:[EMAIL PROTECTED]] > Sent: Monday, July 01, 2002 2:32 PM > To: '[EMAIL PROTECTED]' > Subject: printf question > > > Hi, > > Can anyone tell me how to print the following data so that it > rounds up even > thoug

printf question

2002-07-01 Thread Ned Cunningham
Hi, Can anyone tell me how to print the following data so that it rounds up even though it shouldn't $data = "3.424"; Printf WRFILE ("%11.2f", $data); My results are 3.42 I need it to round up even if it is only .001 ? TIA -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additio