Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

FMTBCDField problem

Status
Not open for further replies.

abbath8

Programmer
Sep 20, 2003
40
0
0
HU
Hi,

I have an Oracle 9i table with a FLOAT field. There is a dbxpress clientdataset I query the table into. If I want to give some value for the float field:

CDatasetFLOATFIELD.AsFloat := <some double variable>

only 4 decimals will be saved with rounding. So when I try:

doublevar := 1.12345678
CDatasetFLOATFIELD.AsFloat := doublevar;

the value of the field will be 1.1235

The field is a TFMTBCDField which supports more than 4 decimals as I know. What is the problem? What do I do wrong?
 

Look at the EnableBCD property of the TCustomADODataSet.

 
It's not an ADODataSet, it's a ClientDataset...
 
When I write:

CDatasetFLOATFIELD.AsString := floattostr(doublevar);

then the field gets the value correctly. Ok this is not a solution, but what is wrong with the AsFloat (or Value as well)??? Why does it round the number to 4 decimals?
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top