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
Eduardo Mauro
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.
you can use the DisplayFormat property of the field to format.
check this sample
TFloatField(YourDataSet.FieldByName('field')).DisplayFormat := '#,##0.00';
来源:https://stackoverflow.com/questions/3619835/delphi-dbgrid-format-display-values