Delphi DBGrid Format Display Values

Pieter van Wyk picture Pieter van Wyk · Sep 1, 2010 · Viewed 14.7k times · Source

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

Answer

RRUZ picture RRUZ · Sep 1, 2010

you can use the DisplayFormat property of the field to format.

check this sample

TFloatField(YourDataSet.FieldByName('field')).DisplayFormat := '#,##0.00';