谢谢!

解决方案 »

  1.   

    直接强制类型转化
    a:double;
    b:int;
    begin
    a:=0.1;
    b:=a;//b:=(int)a;
      

  2.   

    Round
    这些都行,或者 integer(x)
      

  3.   

    用Trunc() 或者Round(),前者是去掉小数部分,后者是四舍五入,详细的查查帮助看看
      

  4.   

    强制转换或者直接把double附给integer型变量就可以了啊,不过要注意长类型向短类型转换会有截取如果要四舍五入用要这样写
    a:double ;
    b:Integer
    b := StrToInt(FormatFloat('0',a));
      

  5.   

    procedure TForm1.Button1Click(Sender: TObject);
    var
      d: Double;
      i: integer;
    begin
      d:= 12.234;
      i:= Trunc(d);
      Showmessage('asdfasd: '+IntToStr(i));
    end;
      

  6.   

    function Trunc(X: Extended): Int64;