[Lazarus] SQlite format issue in DBGrid with non persistant field definition

John Landmesser jmlandmesser at gmx.de
Wed Jul 31 12:06:57 CEST 2024


Am 31.07.24 um 00:31 schrieb Werner Pamler via lazarus:
> Am 19.07.2024 um 14:40 schrieb John Landmesser via lazarus:
>> The issue is of course gone if i have persistant field definitions where
>> i can set Field.Displayformat
>
> But nothing prevents you to do this also with auto-created fields:
>
>     TFloatField(SQLQuery1.FieldByName('Number')).DisplayFormat :=
> '#,##0.000';
>

Yes i did that allready as a workaround ( thanks to google ):

procedure TForm1.DBGrid2DblClick(Sender : TObject);
var index : integer;
begin
   index := DBGrid2.SelectedField.Index;
   TNumericField(ZQuery2.fields[index]).DisplayFormat := '#,###.000';

end;

But i think its an issue of Zeoslib, that should be fixed.




More information about the lazarus mailing list