RT

解决方案 »

  1.   

    可以在你要现示人民币符号'¥'的那个字段的OnGetText事件实现就可以了
    以下是我一个对日期字段进行格式化的代码
    其中FieldGetText就是OnGetText的实现了(因为我是用在查询里面)。
    ADOQuery1.FieldByName('myfield').OnGetText := FieldGetText;procedure TForm1.FieldGetText(Sender: TField; var Text: string;
      DisplayText: Boolean);
    begin
      if ((Sender As TField).DataType = ftDateTime)
        and (Sender.Value <> Null) then
        Text := FormatDatetime('yyyy-mm-dd hh:nn', (Sender As TField).AsDateTime)
      else Text := Sender.AsString;
    end;
      

  2.   

    那有这么麻烦啊。直接设置属性。
    如果你使用Table,双击Table控件,使用鼠标右键,添加所有字段,然后选择要显示的字段(整数类型或者浮点类型),设置该字段的DisplayFormat为0.00¥就可以了。Query也类似,如果是动态的话,自己写代码吧。在Table.Open后写:Table.Fields[].DisplayFormat:=????就可以了。
    才20分,呜呜,我好可怜。都5点了,好饿。
      

  3.   

    在TABLE的字段屬性設置為﹕
    table1.fields[i].DisplayFormat:=¥0.00