Subject Re: [IBO] retrieving size and precision of numeric fields
Author Jason Wharton
Thank you for reporting this. I just want to report that I did figure out
what I had done incorrectly and it has been resolved. The release I am
working on the finishing touches on will have this in it.

My apologies to all this problem may have affected. For most, it probably
didn't amount to a critical issue but none-the-less I consider this a rather
severe problem that needed fixing.

Kind regards,
Jason Wharton

----- Original Message -----
From: "Salim Naufal" <salim.naufal@...>
To: <IBObjects@yahoogroups.com>
Sent: Monday, June 09, 2003 7:40 AM
Subject: RE: [IBO] retrieving size and precision of numeric fields


> My number has a precision of 2 on the database side. The example I chose
> illustrates three guys going to the restaurant and splitting the bill by
> three. The bill is $100. I am dividing by 3. Two should pay $33.33 and the
> last one $33.34. The calculation I am doing is the following: the first
two
> will pay $100/3 and the third one the balance which should be $33.34. So,
by
> default, I use the onFieldChange trigger of the "Debit" field to compute
the
> amounts:
> Credit1.AsCurrency = Debit.AsCurrency / 3;
> Credit2.AsCurrency = Debit.AsCurrency / 3;
> Credit3.AsCurrency = Debit.AsCurrency - Credit1.AsCurrency -
> Credit2.AsCurrency;
>
> This should ensure that Total Debit = Total Credit
>
> Using IBOQuery Alone, I get the correct rounding done to 2 digits. Using
the
> ClientDatasets Linked to IBObjects, I get the 4 digits problem. It seems
> that the DataSetProvider component is reading the size and precision
fields
> and giving it to the ClientDataSet.