I used this just this week to round measurements to the nearest 32 of an inch

set var vGranularity DOUBLE = 32
set var vNewValue = ((NINT(.vOldValue * .vGranularity) / .vGranularity)

From: [email protected] [mailto:[email protected]] On Behalf Of Karen Tellef
Sent: Thursday, August 21, 2014 1:24 PM
To: RBASE-L Mailing List
Subject: [RBASE-L] - Re: Paying it forward - thanks for an old calculationtip!

You're right it does!   That goes into my notes, much easier to type!

Karen



-----Original Message-----
From: Dennis McGrath <[email protected]<mailto:[email protected]>>
To: RBASE-L Mailing List <[email protected]<mailto:[email protected]>>
Sent: Thu, Aug 21, 2014 1:21 pm
Subject: [RBASE-L] - RE: Paying it forward - thanks for an old calculationtip!
I’ll bet this will do the same

select totaltimess,   (NINT(totaltimess * 2) / 2) from tmphone
Dennis McGrath

From: [email protected]<mailto:[email protected]> 
[mailto:[email protected]<mailto:[email protected]?>] On Behalf Of Karen Tellef
Sent: Thursday, August 21, 2014 1:04 PM
To: RBASE-L Mailing List
Subject: [RBASE-L] - Paying it forward - thanks for an old calculation tip!

Don't know who first posted this tip (hopefully no one will get ticked off 
because I don't remember who).  But it's an oldy but goody that I needed to 
have today and never used before!    So in case anyone else can use this 
code....

I got a request to round a number up or down to the nearest .5 increment.  Such 
as:
       9.05    9.0
        19.61    19.5
        3.7        3.5
        3.9        4.0
        0.37    0.5

Sure enough, found this lovely calculation in my notes:
    select totaltimess, (.50 * (int( 2 * (totaltimess + .25)))) from tmphone

Works great!!

Karen

Reply via email to