procedure TForm1.Button1Click(Sender: TObject); var tp:String; I:Integer; R:Integer; begin tp:=Edit1.Text; I:=Pos('.',tp); If I>0 then R:=StrToInt(Copy(tp,1,I-1)) Else R:=StrToInt(tp); end;
procedure TForm1.Button1Click(Sender: TObject); var tp:String; I:Integer; R:Integer; begin tp:=Edit1.Text; R := Trunc(StoToFloat(tp)); end;
var
tp:String;
I:Integer;
R:Integer;
begin
tp:=Edit1.Text;
I:=Pos('.',tp);
If I>0 then
R:=StrToInt(Copy(tp,1,I-1))
Else
R:=StrToInt(tp);
end;
var
tp:String;
I:Integer;
R:Integer;
begin
tp:=Edit1.Text;
R := Trunc(StoToFloat(tp));
end;