int(StrToFloat('284.1481408992224'))=284

解决方案 »

  1.   

    a=inttostr('284.1481408992224');
    for i:=1 to length(a) do
    if a[i]<>'.' then b=b+a[i] else exit;
      

  2.   

    strtofloat是处理不了这个数的,我试过了。真是烦人!
    如果真的不行只好采用白河愁大侠的意见了
      

  3.   

    var wdm:double  ;
        s:string ;
    begin
      wdm:=284.1481408992224  ;
      s:=format('%18.14f',[wdm]) ;
    end ;
      

  4.   

    var i:integer;
    s:string;
    begin
    s:='284.1481408992224';
    s:=copy(s,1,3);
    i:=StrToInt(s);
    end;
      

  5.   

    int(StrToFloat('284.1481408992224'))=284  
      

  6.   

    这样保证出来284!
    procedure TForm1.Button4Click(Sender: TObject);
    begin if round(StrToFloat('284.1481408992224'))=284 then
     begin
            ShowMessage('Hello');
     end;
    end;