Subject Re[2]: [ib-support] Rounding erros in calculated columns ?
Author Carlos H. Cantu
Hi !

I dont know the dialect because its not me who got the problem... that
question was given by an user of my mailing list (Interbase-BR). I will
give your answer to him.

Thanks !!

[]s

Carlos
WarmBoot Informatica - http://www.warmboot.com.br
Interbase-BR - http://www.interbase-br.com

S> What dialect are you running? I guess you're running with dialect 1 which uses double precision for numeric > 8.
S> I had the same problem when using double precision. I solved it by casting it to exact numeric:

S> NEW.TOTAL = CAST((NEW.A + NEW.B - NEW.C) AS NUMERIC(18, 2))

S> On Mon, Jul 02, 2001 at 08:29:49AM -0300, Carlos H. Cantu wrote:
>> An user reported this to me... anybody knows something about it ? Is it a
>> bug ? :
>>
>> I have a calculated column :
>>
>> NEW.TOTAL= NEW.A + NEW.B - NEW.C
>>
>> A,B and C are Numeric(15,2)
>>
>> * Sometimes * the result is wrong, like :
>>
>> Ex. A=9.82 , B=0 e C=0 => Total= 10.00
>>
>> * Sometimes * if I update the record the total value is corrected.

S> To unsubscribe from this group, send an email to:
S> ib-support-unsubscribe@egroups.com



S> Your use of Yahoo! Groups is subject to http://docs.yahoo.com/info/terms/