Subject | Firebird & double precision |
---|---|
Author | José Manuel |
Post date | 2002-04-18T09:00:59Z |
Hi,
How must i define a computed field for take only 2 decimal places?
by example when i define this table:
CREATE TABLE IVA (IV_CONTA STRING NOT NULL,
IV_CONTADOR INTEGER NOT NULL,
IV_TOTALFAC NUMERIC(15,2) DEFAULT 0 NOT NULL,
IV_RET_CUOTA NUMERIC(15,2) DEFAULT 0 NOT NULL,
IV_TOTLIQ COMPUTED BY (IV_TOTALFAC - IV_RET_CUOTA),
CONSTRAINT IVA_PK PRIMARY KEY
(IV_CONTA,IV_CONTADOR));
The value for iv_totalfac & iv_ret_cuota come from a procedure and i see
this view:
iv_totalfac iv_ret_cuota iv_totliq
-------------- ------------- ----------------------
100.20 82.01 18.1900000000115
10.15 10.15 0.00000000000041
why i don't get the correct computed value (it should be 18.19 and 0)
thank in advance.
PD.- Excuse my English.
-----
José Manuel
CACERES (Spain)
How must i define a computed field for take only 2 decimal places?
by example when i define this table:
CREATE TABLE IVA (IV_CONTA STRING NOT NULL,
IV_CONTADOR INTEGER NOT NULL,
IV_TOTALFAC NUMERIC(15,2) DEFAULT 0 NOT NULL,
IV_RET_CUOTA NUMERIC(15,2) DEFAULT 0 NOT NULL,
IV_TOTLIQ COMPUTED BY (IV_TOTALFAC - IV_RET_CUOTA),
CONSTRAINT IVA_PK PRIMARY KEY
(IV_CONTA,IV_CONTADOR));
The value for iv_totalfac & iv_ret_cuota come from a procedure and i see
this view:
iv_totalfac iv_ret_cuota iv_totliq
-------------- ------------- ----------------------
100.20 82.01 18.1900000000115
10.15 10.15 0.00000000000041
why i don't get the correct computed value (it should be 18.19 and 0)
thank in advance.
PD.- Excuse my English.
-----
José Manuel
CACERES (Spain)