tfield

Delphi TFloatField.DisplayFormat for numeric fields less than 1.0

大城市里の小女人 提交于 2020-01-11 06:13:29
问题 This is my procedure. procedure format_integer_field(Atable: TDataSet); var i: integer; begin if Atable.Active then if Atable.FieldCount > 0 then with Atable do begin for i:= 0 to FieldCount-1 do if (Fields[i] is TIntegerField) then begin (Fields[i] as TIntegerField).DisplayFormat := '###,###'; (Fields[i] as TIntegerField).EditFormat := '#'; end else if (Fields[i] is TFloatField) then begin (Fields[i] as TFloatField).DisplayFormat := '###,###.##'; (Fields[i] as TFloatField).EditFormat := '#.#