Subject Re: [IBO] Numeric Fields
Author Geoff Worboys
> DOLLAR_AMT NUMERIC(12,2) DEFAULT 0.0 NOT NULL;
>
> Plopped it on a form, and entered 1.46 the TDBEdit Control
> came up with 9232374082633.6166 would much more reasonable.
> I took a look at what actually got to IB and it says 0.

What versions of everything? Particularly interbase version and
dialect.

There is a bug in IB6 dialect 1 relating to numerics, but I believe
you should only hit it when calculating with numeric(9,x) and lower.
AFAICT the problem happens when the result of a calculation flows over
from INT32 storage to double - that is; the result of the calculation
is requires 10 or more digits, while the factors required only 9 or
less digits.
NUMERIC(6,2) * NUMERIC(6,2) gives NUMERIC(6,4)

Also Jason made some changes relating to TIBO* stuff and numerics
during one of the versions and there were some problem - not sure of
the details.


> My guess is this is some kind of conversion not getting done,
> anyone know of a resolution other then a search for
> NUMERIC(12,2) and replace with DOUBLE PRECISION and rebuilding
> the database, it's not production so this is an option...

Sounds to me like you should be using domains. Create a domain
CURRENCY_D and define it as required - using it in the tables as
required. You will still have to search trigger and procedure code to
make changes, I add the domain name as a comment next to all
parameter, returns and variable declarations to assist with this.


Geoff Worboys
Telesis Computing