Subject | Problem with IBO 4.2Fb in Numeric Field |
---|---|
Author | sassicaia70@hotmail.com |
Post date | 2001-11-06T11:09:05Z |
I have a problem with IBO 4.2Fb.
I use IBOTable with Pessimistic Lock.
Database:
/* Original table name is "Rigapeso.DBF" */
CREATE TABLE "RIGAPESO" (
"ID" INTEGER NOT NULL PRIMARY KEY,
"PNETTORIGA" NUMERIC(18, 3) DEFAULT '0' /* "PNETTORIGA" */ ,
"PLORDORIGA" NUMERIC(18, 3) DEFAULT '0' /* "PLORDORIGA" */ ,
"PTARARIGA" NUMERIC(18, 3) DEFAULT '0' /* "PTARARIGA" */ ,
"PPEZZIRIGA" NUMERIC(10, 0) DEFAULT '0' /* "PPEZZIRIGA" */ ,
"PCARTRIGA" NUMERIC(10, 0) DEFAULT '0' /* "PCARTRIGA" */ ,
"PPALLRIGA" NUMERIC(10, 0) DEFAULT '0' /* "PPALLRIGA" */ ,
"PIMPRIGA" NUMERIC(18, 3) DEFAULT '0' /* "PIMPRIGA" */
);
Source:
with IBOTable1 do begin
Open;
Edit;
FieldByName('PNETTORIGA').AsCurrency := 0;
Post;
//
Edit;
FieldByName('PNETTORIGA').AsCurrency := 2.059;
Post;
//
Edit;
FieldByName('PNETTORIGA').AsCurrency :=
FieldByName('PNETTORIGA').AsCurrency + 3.733;
Post;
//
//
// the result : FieldByName('PNETTORIGA').AsCurrency is 5.791
//
// But the correct result is 5.792
//
//
end;
Why ??
How can solve this problem ??
P.S.
Thanks very much
Roberto Govoni
I use IBOTable with Pessimistic Lock.
Database:
/* Original table name is "Rigapeso.DBF" */
CREATE TABLE "RIGAPESO" (
"ID" INTEGER NOT NULL PRIMARY KEY,
"PNETTORIGA" NUMERIC(18, 3) DEFAULT '0' /* "PNETTORIGA" */ ,
"PLORDORIGA" NUMERIC(18, 3) DEFAULT '0' /* "PLORDORIGA" */ ,
"PTARARIGA" NUMERIC(18, 3) DEFAULT '0' /* "PTARARIGA" */ ,
"PPEZZIRIGA" NUMERIC(10, 0) DEFAULT '0' /* "PPEZZIRIGA" */ ,
"PCARTRIGA" NUMERIC(10, 0) DEFAULT '0' /* "PCARTRIGA" */ ,
"PPALLRIGA" NUMERIC(10, 0) DEFAULT '0' /* "PPALLRIGA" */ ,
"PIMPRIGA" NUMERIC(18, 3) DEFAULT '0' /* "PIMPRIGA" */
);
Source:
with IBOTable1 do begin
Open;
Edit;
FieldByName('PNETTORIGA').AsCurrency := 0;
Post;
//
Edit;
FieldByName('PNETTORIGA').AsCurrency := 2.059;
Post;
//
Edit;
FieldByName('PNETTORIGA').AsCurrency :=
FieldByName('PNETTORIGA').AsCurrency + 3.733;
Post;
//
//
// the result : FieldByName('PNETTORIGA').AsCurrency is 5.791
//
// But the correct result is 5.792
//
//
end;
Why ??
How can solve this problem ??
P.S.
Thanks very much
Roberto Govoni