edit1.text:=Format('%.2f',[10532.175]); //10532.17
edit1.text:=Format('%.2f',[10532.185]); //10532.18
edit1.text:=Format('%.2f',[10532.195]); //10532.19
edit1.text:=Format('%.2f',[10532.165]); //10532.17
edit1.text:=Format('%.2f',[10532.155]); //10532.16
怎么解释五入

解决方案 »

  1.   

    自己再好好运行一遍看看我的是:
    edit1.text:=Format('%.2f',[10532.175]); //10532.18
    edit1.text:=Format('%.2f',[10532.185]); //10532.19
    edit1.text:=Format('%.2f',[10532.195]); //10532.20
    edit1.text:=Format('%.2f',[10532.165]); //10532.17
    edit1.text:=Format('%.2f',[10532.155]); //10532.16
      

  2.   

    是这样的
    var a:real;    
    begin
      a:=10532.175;
      edit1.text:=Format('%.2f',[a]);
    end;edit1.text中的内容为10532.17是怎么回事
      

  3.   

    var a:Extended;    
    begin
      a:=10532.175;
      edit1.text:=Format('%.2f',[a]);
    end;
      

  4.   

    A real type defines a set of numbers that can be represented with floating-point notation. The table below gives the ranges and storage formats for the fundamental real types.Fundamental real types 
    Type Range Significant digits Size in bytes
    Real48 2.9 x 10^-39 .. 1.7 x 10^38 11-12 6
    Single 1.5 x 10^-45 .. 3.4 x 10^38 7-8 4
    Double 5.0 x 10^-324 .. 1.7 x 10^308 15-16 8
    Extended 3.6 x 10^-4951 .. 1.1 x 10^4932 19-20 10
    Comp -2^63+1 .. 2^63 -1 19-20 8
    Currency -922337203685477.5808.. 922337203685477.5807 19-20 8
      

  5.   

    我运行的也是:
    edit1.text:=Format('%.2f',[10532.175]); //10532.18
    edit1.text:=Format('%.2f',[10532.185]); //10532.19
    edit1.text:=Format('%.2f',[10532.195]); //10532.20
    edit1.text:=Format('%.2f',[10532.165]); //10532.17
    edit1.text:=Format('%.2f',[10532.155]); //10532.16
      

  6.   

    我也只须在需要转换的变量前加round即可
      

  7.   

    呵呵银行家四舍五入法来的http://lysoft.7u7.net