Thanks all who volunteered a solution. But it was fixed in update 1.866 for dos Serves me right for not being current!
----- Original Message ----- From: "Javier Valencia" <[EMAIL PROTECTED]> To: "RBASE-L Mailing List" <[EMAIL PROTECTED]> Sent: Tuesday, June 17, 2003 5:29 PM Subject: [RBASE-L] - Re: tax calc v6.5++ vs v7.0 > Bernie: > I believe that what you need is the BRND function, enclosed is the > description from the help files, hopefully it will solve your problem... > > Syntax: (BRND(arg1,arg2,arg3)) > The first argument of the function is the number to be rounded. > The second argument is the total number of digits to return in the result. > You can just leave this at 15, for example, if you want to return all > digits. > The third argument of the function indicates where to round. This is the one > that is often hard to figure out. It is easiest to think of this argument as > the number of zeros or places to keep and then round the next place. > For example, .001, is two places or zeros to keep and then the next number > to the right is rounded. 1000 is three places or zeros to keep and then the > next number to the left is rounded. > You can easily see this by looking a series of BRND functions: > The starting number is 1234567.76543 > (BRND(1234567.76543,15,0.0001)) returns 1234567.7654 > (BRND(1234567.76543,15,0.001)) returns 1234567.765 > (BRND(1234567.76543,15,0.01)) returns 1234567.77 > (BRND(1234567.76543,15,0.1)) returns 1234567.8 > (BRND(1234567.76543,15,1.)) returns 1234568. > (BRND(1234567.76543,15,10.)) returns 1234570. > (BRND(1234567.76543,15,100.)) returns 1234600. > (BRND(1234567.76543,15,1000.)) returns 1235000. > (BRND(1234567.76543,15,10000.)) returns 1230000. > The BRND function does what is called Banker's Rounding. If the number to be > rounded is even at the rounding digit, then the number is not rounded. If > the digit is odd, then the number is rounded. > Look at an example rounding to two decimal places. > BRND(1234567.765,15,0.01) returns 1234567.76 > BRND(1234567.775,15,0.01) returns 1234567.78 > The odd number, .775, is rounded, the even number, .765, is not. > The digit that is used to test odd or even is the digit at the rounding > location, in this case the number two decimal places to the right. > Valid data types: REAL, DOUBLE, or CURRENCY. > BRND function has been enhanced to handle very small as well as very large > values. > Examples of using BRND function when using very small and very large values: > (BRND(0.01,6,0.01)) returns 0.01 > (BRND(1.009,6,0.01)) returns 1.01 > (BRND(0.009,6,0.01)) returns 0.01 > (BRND(1999,6,1000)) returns 2000 > (BRND(999,6,1000)) returns 1000 > > > Javier Valencia, PE > President > Valencia Technology Group, L.L.C. > 14315 S. Twilight Ln, Suite #14 > Olathe, Kansas 66962-4578 > Office (913)829-0888 > Fax (913)649-2904 > Cell (913)915-3137 > > -----Original Message----- > From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Behalf Of Bernard Lis > Sent: Tuesday, June 17, 2003 3:46 PM > To: RBASE-L Mailing List > Subject: [RBASE-L] - Re: tax calc v6.5++ vs v7.0 > > Dennis, Bill,Terry,Javier > Thanks but -- > Round function reqires that amt be double. So I made it double and did the > formula below and it still comes out to .55 should be 56. > using more digits to right of decimal doesn't help because they are all > .55555 > My solution is to have the customer change his price to 9.26 <g> > > Bernie > ----- Original Message ----- > From: "Dennis McGrath" <[EMAIL PROTECTED]> > To: "RBASE-L Mailing List" <[EMAIL PROTECTED]> > Sent: Tuesday, June 17, 2003 1:10 PM > Subject: [RBASE-L] - Re: tax calc v6.5++ vs v7.0 > > > > So it seems the answer is to do calulations in double, round to the > > correct decimal and assign to a currency. > > > > Here is how to force that even though original values are currency > > > > > > set var amt CURR = 9.25 > > set var txrate DOUBLE = 0.06 'WILL FORCE CALULATIONS TO BE DOUBLE > > set var tax CURR = (ROUND((.amt * .txrate), 2) > > > > > > Dennis McGrath > > > > > >

