Subject Re: [IBO] retrieving size and precision of numeric fields
Author peter@cyionics.com
Hi Salim

Yes I take your point and you are correct.

However when only working to a precision of 2 or 3 digits I would be inclined, if the numbers are not too large( <64 bits) to use integers anyway.

Personally I think relying on external programs or libraries etc to perform rounding is a dangerous assumption to make, after all there are several different rounding methods and I prefer to use the appropriate one in Delphi for my own usage.


If you worked in integers, the problem you have would be solved, regardless of any bugs that may or may not be present in IBO.

Just my opinion for what it's worth.

Good luck
Peter




----- Original Message -----
From: Salim Naufal
To: IBObjects@yahoogroups.com
Sent: Monday, June 09, 2003 9:37 AM
Subject: RE: [IBO] retrieving size and precision of numeric fields


Hi Peter,

You are correct that 100 cannot be divided by three. The rounding is done by
the TBCD fields and therefore, you should get 33.33 for the first two credit
fields and then, to compensate, I get the difference and store it in the
third credit field. In this case, I get 33.34 for the third field. The point
is that the rounding is done in IBX to 2 digits which is what matched the
numeric(18,2) and in IBO to 4 digits which is incorrect.





Yahoo! Groups Sponsor
ADVERTISEMENT




___________________________________________________________________________
IB Objects - direct, complete, custom connectivity to Firebird or InterBase
without the need for BDE, ODBC or any other layer.
___________________________________________________________________________
http://www.ibobjects.com - your IBO community resource for Tech Info papers,
keyword-searchable FAQ, community code contributions and more !

Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service.


[Non-text portions of this message have been removed]