> >I assume you are talking of Paradox 7 and D2 which I haven't used yet.
> >When I use the DBD and look at a Currency type field in my Paradox 5 table,
> >I see e.g. a value 0.43<Symbol>. Then I press the Field Edit Button -- and what
> >do I get? 0.429999999999836! Does not look like an integer value to me.
> I don't see how this tells you anything. It could be that the field
> editor has a bug, and doesn't convert the strings properly, or you're
> asking to view the field in an inappropriate format.
1) A field editor that converts an integer value to the one given
above would have a serious bug indeed!
2) The DBD does not allow me to chose the display format, but selects
it from the definition given when the table was created.
What I am talking about has nothing to do with Pascal or Delphi per se.Quote:> To figure out what the storage format is, you should read the
> documentation (i.e. the Object Pascal Language Guide for Delphi)
I am talking about how the data is stored in a Paradox 5 table. It is of no
use to have Delphi calculate the values in integer format when they
are converted to floating point format for table storage. Using the Comp data
type, or the new D2 Currency type, is therefore of no use.
Speaking of that, I know that the value which was passed to the table
was _exactly_ 0.43, rounded and viewed with the de*.
All the following refers to manuals shipped with D1. Check in the
Database Application Developer's Guide, page 86, about TField conversion
functions
TFieldType AsFloat
TCurrencyField Float type by definition
^^^^^^^^^^^^^^^^^^^^^^^^
Local Interbase User's Guide, page 185, Paradox to BDE Logical to dBASE
Data Type Translations
Paradox Physical BDE Logical dBASE
fldPDXMONEY fldFLOAT/fldstMONEY fldDBFLOAT{20.4}
^^^^^^^^
page 186, dBASE to BDE Logical to Paradox Data Type Translation says
dBASE Physical BDE Logical Paradox
fldDBFLOAT fldFLOAT fldPDXNUM
Neither does using INTERBASE help, it only knows integers (32 bits max)
and single and double precision formats. See Interbase Data Definition Guide,
page 50ff. Yes, I printed the whole manual AND read it too.
The followings is a direct extract from the BDE.INT file of the
Delphi 2 Developer CD-ROM
//begin extract
{ Field Types (Logical) }
fldUNKNOWN = 0;
fldZSTRING = 1; { Null terminated string }
fldDATE = 2; { Date (32 bit) }
fldBLOB = 3; { Blob }
fldBOOL = 4; { Boolean (16 bit) }
fldINT16 = 5; { 16 bit signed number }
fldINT32 = 6; { 32 bit signed number }
fldFLOAT = 7; { 64 bit floating point }
fldBCD = 8; { BCD }
fldBYTES = 9; { Fixed number of bytes }
fldTIME = 10; { Time (32 bit) }
fldTIMESTAMP = 11; { Time-stamp (64 bit) }
fldUINT16 = 12; { Unsigned 16 bit integer }
fldUINT32 = 13; { Unsigned 32 bit integer }
fldFLOATIEEE = 14; { 80-bit IEEE float }
fldVARBYTES = 15; { Length prefixed var bytes }
fldLOCKINFO = 16; { Look for LOCKINFO typedef }
MAXLOGFLDTYPES = 17; { Number of logical fieldtypes }
{ Sub Types (Logical) }
{ fldFLOAT subtype }
fldstMONEY = 21; { Money }
//end extract
IMO you are talking rubbish. BTW, why is this a private discussion
from your side? I would think that the problem of rounding and especially
the handling of currency values would be a matter of great general
interest and thus belongs into the ng.
Regards
--
Peter Reber