Date: Thu, 14 Jun 2001 16:16:41 -0400
Reply-To: Howard Schreier <Howard_Schreier@ITA.DOC.GOV>
Sender: "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From: Howard Schreier <Howard_Schreier@ITA.DOC.GOV>
Subject: Re: Round up Not down
It seems that the data are being recorded in intervals of 1/128, stored to
four decimal places. You want to round to intervals of 1/64, also stored to
four decimal places. You want 9/128 to round up to 5/64 even though it's
already been rounded to something closer to 1/16.
Try
data a128ths;
do i = 0 to 128;
from = round(18 + i/128,0.0001);
to = round(round(from * 128 + 0.5,2) / 128,0.0001);
output;
end;
run;
The 0.5 is just a somewhat arbitrary term to make sure that knife-edge
values tip the right way.
On Thu, 14 Jun 2001 12:37:20 -0500, Terry J Kohls <tjkohls@VPICORP.COM>
wrote:
>Hi Folks,
>
>My figure is 18.0703, and it lies just below the median of 18.0625 and
18.0781.
>I want 18.0703 to round up to 18.0781 and not down to 18.0625. How, using
the
>round function, can I accomplish this? Maybe the round function is not the
way to
>go. I'm a newbe. What other function will work for this. Fuzz?
>
>Terry
>_____________________________
>Terry J. Kohls
>Lab Technician
>VPI, LLC
>tjkohls@vpicorp.com
>
|