Subject | Re: [ib-support] Rounding erros in calculated columns ? |
---|---|
Author | Sindunata |
Post date | 2001-07-03T02:27:35Z |
What dialect are you running? I guess you're running with dialect 1 which uses double precision for numeric > 8.
I had the same problem when using double precision. I solved it by casting it to exact numeric:
NEW.TOTAL = CAST((NEW.A + NEW.B - NEW.C) AS NUMERIC(18, 2))
I had the same problem when using double precision. I solved it by casting it to exact numeric:
NEW.TOTAL = CAST((NEW.A + NEW.B - NEW.C) AS NUMERIC(18, 2))
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.