设置了 DisplayFormat 为#0.00   但是出现一片0.00 很不易察看向设置为 不显示0 或 0.00 其他的则 使用 #0.00而且 我的 adoquery 里没有 固定字段  都是根据另一表里的数据生成的查询语句  就是可能有很多个字段查了一些  if Sender.AsFloat>0 then
  Text:=FormatFloat('#,##0.00',Sender.AsFloat)
 else
  Text:='';有不知道该怎么用   谢谢各位了!!!

解决方案 »

  1.   

    还有dbgrideh  下面 还设置了  Footer.valueType:=fvtsum;如果从查询语句里就置为 空 则  dbgrideh  的 Footer 会出错..............
      

  2.   

    将DisplayFormat   设置为#0.##.这样就可以不显示为零的字符串.
      

  3.   

    dbgrid属性里没找到DisplayFormat啊?
      

  4.   

    这个可以procedure Tfmssyreturn.DBGrid3DrawColumnCell(Sender: TObject;
    const Rect: TRect; DataCol: Integer; Column: TColumnEh;
    State: TGridDrawState);
    beginif Column.FieldName = 'pay1' then
    if Column.Field.AsInteger = 0 then
    TDBGrid(Sender).Canvas.FillRect(Rect);if Column.FieldName = 'pay2' then
    if Column.Field.AsInteger = 0 then
    TDBGrid(Sender).Canvas.FillRect(Rect);if Column.FieldName = 'sl' then
    if Column.Field.AsInteger = 0 then
    TDBGrid(Sender).Canvas.FillRect(Rect);if Column.FieldName = 'hts' then
    if Column.Field.AsInteger = 0 then
    TDBGrid(Sender).Canvas.FillRect(Rect);end;