Delphi DBGrid Format Display Values
14,974
Solution 1
Each Field in your DataSet has two events: OnGetText and OnSetText. Use event OnGetText of desired fields and use Format function to format the value using a mask.
Solution 2
you can use the DisplayFormat property of the field to format.
check this sample
TFloatField(YourDataSet.FieldByName('field')).DisplayFormat := '#,##0.00';
Author by
Pieter van Wyk
Delphi application developer. Brentwood and Manningtree, UK.
Updated on June 27, 2022Comments
-
Pieter van Wyk almost 2 years
I need to format values in a
DBGrid
to display in a certain format ex'#,##0.00'
. Any idea how to do that?Regards, Pieter