如DBEDIT1.TEXT:='2563.50'格式化为2,560.00

解决方案 »

  1.   

    如DBEDIT1.TEXT:='2563.50'格式化为2,560.00   ? 你的转换规则不是很明白
     
    这个一般是在DBEDIT1的 change 事件里面写相关转换代码哦
      

  2.   

    自己写函数,然后在事件里调用。这样代码可以重用。
    function FormatMoney(ACurrency: Currency): String;
      

  3.   

    var tempfloat:single;
    code:integer;
    begin
    val(edit1.text,tempfloat,code);
    if code=0 then
        edit1.text:=format("#,##0.#0",tempfloat);
      

  4.   

    着急写成format了,应该是formatfloat
    var tempfloat:single;
    code:integer;
    begin
    val(edit1.text,tempfloat,code);
    if code=0 then
        edit1.text:=formatfloat("#,##0.#0",tempfloat);
    end;
      

  5.   

    还要把个位数去掉啊
    再改
    var tempfloat:single;
    code:integer;
    begin
    val(edit1.text,tempfloat,code);
    tempfloat:=strtofloat(floattostrf(tempfloat/10,ffFixed,100,0))*10;
    tempfloat:=
    if code=0 then
        edit1.text:=formatfloat("#,##0.#0",tempfloat);
    end;
      

  6.   

    DBEDIT1.TEXT := FormatFloat('#,#0.00',2563.50)