编程语言

img zhlfdm

显示数据库时数字保留1位小数等

发表于2008/9/30 18:57:00  764人阅读

分类: 转贴

Tfloatfield(query1.fieldbyname('your_field')).displayformat   :=   '#0.00'

 

procedure Tfrm_main.DBGxxDrawColumnCell(Sender: TObject; const Rect: TRect;
  DataCol: Integer; Column: TColumn; State: TGridDrawState);
begin
try
Tfloatfield(adoqxx.fieldbyname('i_0w')).displayformat:='#0.0';
Tfloatfield(adoqxx.fieldbyname('i_1w')).displayformat:='#0.0';
Tfloatfield(adoqxx.fieldbyname('i_2w')).displayformat:='#0.0';
Tfloatfield(adoqxx.fieldbyname('i_3w')).displayformat:='#0.0';
Tfloatfield(adoqxx.fieldbyname('i_4w')).displayformat:='#0.0';
Tfloatfield(adoqxx.fieldbyname('i_5w')).displayformat:='#0.0';
Tfloatfield(adoqxx.fieldbyname('i_6w')).displayformat:='#0.0';
Tfloatfield(adoqxx.fieldbyname('i_7w')).displayformat:='#0.0';
Tfloatfield(adoqxx.fieldbyname('i_8w')).displayformat:='#0.0';
Tfloatfield(adoqxx.fieldbyname('i_9w')).displayformat:='#0.0';
Tfloatfield(adoqxx.fieldbyname('i_10w')).displayformat:='#0.0';
finally
end;
end;

阅读全文
0 0

相关文章推荐

img
取 消
img