Doesn't Banker's rounding sometimes round up and sometimes round down?

If Rachel needs to always round down then
Set var vTax = (INT(.vTax*100)/100)
will always round down to 2 decimal places

Dennis McGrath

-----Original Message-----
From: [email protected] [mailto:[EMAIL PROTECTED] On Behalf Of A. Razzak Memon
Sent: Wednesday, December 03, 2008 11:58 AM
To: RBASE-L Mailing List
Subject: [RBASE-L] - Re: rounding tax amounts down...

At 12:18 PM 12/3/2008, Rachael Malberg wrote:

well got a canidate question for 'stump the R:cumps'...

>so sales tax in this fine state is .065%, I've got a computed currency
>column that calculates the amount but a $23 sale results is $1.495 and
>rounded to $1.50 but it turns out it needs to be $1.49 anyone got a
>solution?

Rachael,

Try the Banker's Rounding (BRND) function of R:BASE. Using the enhanced
option, you may now specify the exact precision of decimal number to be
rounded.

Syntax: (BRND(arg1,arg2,arg3))

Rounds REAL, DOUBLE, or CURRENCY data to a specific number of decimal
places and allows specification of the number of significant digits
to return. Arg1 is the value to be rounded. Arg2 is the number of
significant digits to return, and arg3 is the precision The precision
is specified as a decimal number, for example, .01 rounds to two
decimal places.

In the following example, the value of vResult is 1234.57.

SET VAR vResult = (BRND(1234.5678342,8,.01))

Hope that helps!

Very Best R:egards,

Razzak.


Reply via email to