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 TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

precision and TFloatField

Status
Not open for further replies.

mwitwer

Programmer
May 14, 2002
13
US
I'm having trouble with a numeric value displaying in scientific notation in a grid field. The required maximum enter and display width for the grid field is 20 chars. It looks like TFloatField.Precision defaults to 15. I think because of this whenever you enter a number in the grid that has more than 15 digits (or decimal digits), it is automatically reformatted to be displayed in scientific notation. I've tried to set the precision at design-time to 20, but it seems to keep resetting itself to 15. I also tried setting the DisplayFormat property. This seemed to prevent the number from displaying in scientific notation when there was more than 15, but it did not prevent it altogether; also, the last few digits would sometimes change for some reason after tabbing.

Any ideas on how I can get my 20-digit numeric field to display exactly as I type it in, at all times?

Thanks
 
The following was extracted from the Delphi Help file at the bottom of the page identified by "TCustomADODataSet.EnableBCD":

Note: For fields with very large numbers of more than 19 significant digits, you can use TVariantField type persistent field objects. The TFloatField and TBCDField classes lack sufficient capacity for fields of this size. TVariantField allows the getting and setting of the field data as strings, preventing without loss of data due to insufficient capacity. However, arithmetic operations cannot be performed on numbers accessed through a TVariantField object.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top