Richard, Try making Quantity and Price currency. Unless you need to display $$ signs or sell in quantities < .01 this will solve the problem. Also; the currency data type does it's own rounding.
Ben Petersen On 6 Jun 2002, at 8:17, Richard Kahl wrote: > Thanks but I wish it was that simple. The problem is occuring in a computed > column. > column 1 quantity real > column 2 price currency > column 3 subtotal currency = (quantity * price) > when quantity = 12.5 ,price = 36.55,subtotal shows as 456.87 should round to > 456.88 > In another example > set var v1 double = 456.875 > set var v2 double = (12.5 * 36.55) > set var v1a double = (round(.v1,2)) > set var 2a double = (round(.v2,2)) > in this case > v1a = 456.88 > v2a = 456.87 > > Am I doing something wrong? > > Thanks > Richard Kahl > > ----- Original Message ----- > From: "A. Razzak Memon" <[EMAIL PROTECTED]> > To: <[EMAIL PROTECTED]> > Sent: Wednesday, June 05, 2002 10:46 PM > Subject: Re: values rounding incorrectly - Razzak's Reply > > > > > > At 10:22 PM 6/5/02 -0400, Richard Kahl wrote: > > > > >When performing calculations with currency or using the > > >round function the values are not rounding correctly. ex > > >set var vamt = (round(125.875,2)) is yielding 125.87 set > > >var vamt = (12.5 * 36.55) is yielding 456.87 using 6.5++ > > >build 1.851 Does anyone know of what could cause this? > > > > Richard, > > > > You MUST define the data type first. > > > > Syntax for ROUND: > > > > Syntax: (ROUND(arg1, arg2)) > > Where : arg1 is the value to be rounded > > arg2 is the position to be rounded after the > > decimal point. > > > > Example 01: > > > > SET VAR vAmt CURRENCY > > SET VAR vAmt = (ROUND(125.875,2)) > > > > Example 02: > > > > SET VAR vAmt CURRENCY = (ROUND(125.875,2)) > > > > Example 03: > > > > SET VAR vAmt DOUBLE > > SET VAR vAmt = (ROUND(125.875,2)) > > > > Example 04: > > > > SET VAR vAmt DOUBLE = (ROUND(125.875,2)) > > > > Enjoy and make sure to have fun! > > > > Very Best Regards, > > > > Razzak. > > > > > > > > > > ================================================ > > TO SEE MESSAGE POSTING GUIDELINES: > > Send a plain text email to [EMAIL PROTECTED] > > In the message body, put just two words: INTRO rbase-l > > ================================================ > > TO UNSUBSCRIBE: send a plain text email to [EMAIL PROTECTED] > > In the message body, put just two words: UNSUBSCRIBE rbase-l > > ================================================ > > TO SEARCH ARCHIVES: > > http://www.mail-archive.com/rbase-l%40sonetmail.com/ > > > ================================================ > TO SEE MESSAGE POSTING GUIDELINES: > Send a plain text email to [EMAIL PROTECTED] > In the message body, put just two words: INTRO rbase-l > ================================================ > TO UNSUBSCRIBE: send a plain text email to [EMAIL PROTECTED] > In the message body, put just two words: UNSUBSCRIBE rbase-l > ================================================ > TO SEARCH ARCHIVES: > http://www.mail-archive.com/rbase-l%40sonetmail.com/ > ================================================ TO SEE MESSAGE POSTING GUIDELINES: Send a plain text email to [EMAIL PROTECTED] In the message body, put just two words: INTRO rbase-l ================================================ TO UNSUBSCRIBE: send a plain text email to [EMAIL PROTECTED] In the message body, put just two words: UNSUBSCRIBE rbase-l ================================================ TO SEARCH ARCHIVES: http://www.mail-archive.com/rbase-l%40sonetmail.com/
