Razzak:
Thanks for replying. What would really be "gloriously" great would be to
have a SuperMath function similar to a famous spreadsheet's round function.
The syntax is:
ROUND(<value>,<# of decimal places>)
So in my example I could have:
ROUND((.VMAX - .VMIN) * .5,4) which would round .00145 up to .0015.
I have no idea how difficult this would be to implement and maybe it's
already been thought about for the magical version 7.0 -- you have so many
wonderful surprises up your sleeves!
At any rate I know you'll do your best to clean up this little boo-boo.
Thanks again -- Mike Ramsour
> -----Original Message-----
> From: A. Razzak Memon [SMTP:[EMAIL PROTECTED]]
> Sent: Friday, June 01, 2001 04:55 PM
> To: [EMAIL PROTECTED]
> Subject: Re: Rounding question - Razzak's Reply
>
>
>
>
>
>
> Mike Ramsour/Larry Lustig,
>
> Hmmmm...
>
> Looks like the good one to fine tune for upcoming version
> of The Glorious R:BASE 2000 (ver 6.5++), to be released
> on June 15, 2001.
>
> I'll mention this to R:Team members during this afternoon
> meeting in Seattle.
>
> Mike,
>
> THANKS for bringing this to our attention. I personally
> appreciate your efforts.
>
> Stay tuned ...
>
> Very Best Regards,
>
> Razzak.
>
>
> At 01:28 PM 6/1/2001 -0700, Lawrence Lustig wrote:
>
> >In the help file it doesn't say what ANINT will do
> >with a .5 value, but trying your code sure looks like
> >it's truncing that value instead of rounding up (doing
> >it with 14.5001 does produce 15).
>
> >You can get the result you're looking for with
> >(INT(.vDiff + .5))
>
> At 04:05 PM 6/1/2001 -0400, Mike Ramsour wrote:
>
> >I am trying to round a double data type to 4 decimal places.
> >Here is an example of the code I am testing:
> >
> >SET VAR VMAX DOUBLE = .032
> >SET VAR VMIN DOUBLE = .0291
> >SET VAR VDIFF DOUBLE = (((.VMAX - .VMIN) * 10000) / 2)
> >SET VAR VAINT = (AINT(.VDIFF))
> >SET VAR VANINT = (ANINT(.VDIFF))
> >SET VAR VINT = (INT(.VDIFF))
> >SET VAR VNINT = (NINT(.VDIFF))
> >SHOW VAR %INT%
> >
> >The intent is to find the difference between two numbers and determine
> half
> >of the result by either multiplying by .5 or dividing by 2. I am raising
> >the result by 10,000 so that I can use the ANINT function to round off
> the
> >decimal point.
> >
> >The result of the third instruction above is 14.5. According to the way
> I
> >read the ANINT function the fifth instruction should give me an answer of
> 15
> >since VDIFF is equal to 14.5. The result I want is 15 but the answer I
> get
> >is 14 indicating that the value was rounded down. I am not using the
> BRND
> >function but it almost acts like it is.
> >
> >Is there something I'm missing or is there a better way to go about this?
> >
> >Version: RBWIN 6.5++ on NT Workstation 4.0
> >
>
> ===================================-============================
> Official R:BASE List Server: mailto:[EMAIL PROTECTED]
> RBTI Events/Training: http://www.rbase2000.com/events
> R:DCC Members: http://www.rbase2000.com/rdcc
> ================================================================
> R:BASE, Oterro & R:Tango are registered trademarks of RBTI.
> ==================================-=============================
>