Subject RE: [IBO] Precision and Size of TBCDFields
Author Salim Naufal
Hi again Daniel,

I have no problems using the TIBOQuery Component directly linked to the
data aware components. The problem arises when ClientDataSets are used
with the TIBOQuery's.

Since the Size field is set to 8, the ClientDataSet will also set the
Size to 8.
I have a specific example.
Say you have an accounting program and that you work with
ClientDataSets.

Account 1: Debit $100. This amount is to be spread equally to 3 accounts
in the Credits fields so, I should be getting 33.33, 33.33 then 33.34 in
order to balance both sums.
The way we do this is to compute the first two amounts then the third
one is the simply the difference.
Say that the precision is set to 8, with the Field.AsCurrency I get the
following results:
33.3333, 33.3333 and 33.3334 which do balance but when applying the
updates to the database, the results are transformed into 33.33, 33.33
and 33.33 which does not balance anymore.

I have a specific example to illustrate this problem at the following
link:

http://www.softnet-eng.com/demo/IBOProb.zip

It is a 3 kB file.