Re: Re: Re: TField; number of decimals


Posted by webmaster Guido on March 26, 2001 at 15:03:40:

In Reply to: Re: Re: TField; number of decimals posted by Wim Gijse on March 20, 2001 at 17:31:48:

: : : For a euroconversion checklist, I want to filter all the float fields, with 2 decimals. How do I get the number of decimals defined in the .dbf and .db files?
: : : (Total more than 2000 files)
: : : Thanks!
--------------

It all depends of the storage types that are used in the tables:
- if the BCD type is used for a field in a dBASE or a Paradox table, you're lucky: this is the only format for which Delphi can give the number of decimal places (read the "precision" property of a field).
- Paradox has a "Money" type of field. Hopefully, the database-programmers used this... The number of decimal places can not be read, but anyway, you know that it is about money :)
- for the usual "numeric" type in Paradox tables, there simply is not such a thing as decimal places.
- for the "numeric" type in dBASE tables, you only can get the number of decimals by doing a binary read of the table header that contains the structure and by analyzing it. Possible in Delphi, but needs quite some programming.