View Full Version : How to set the number of decimals in DBGrid?
I want to set the number of decimals in DBGrid like x.xxx.
I know about DisplayFormat, but how to use it ?
Try this one:
on the data module - or where the TTable component placed on - double click the TTable component of the DBGrid's Dataset. By right click You can modify the field list that you can use in the application. If You chose a numeric field from these and press F11, you will see the properties for the current field. You can set up the display format for this field the Display Format property field like this:
(additional help in Delphi Help/Index/DisplayFormat,TNumericField
I hope this will help You
I've got the same problem. DisplayFormat is fine at design time, but how about run time?
Query1.Fields[i].DisplayFormat := '###,###.00';
Found the answer - I needed to cast to TNumericField.
if Query1.Fields[i].DataType = ftFloat then
vBulletin® v3.8.7, Copyright ©2000-2013, vBulletin Solutions, Inc.