function stringtonumeric(str:string):numeric; var i,j:integer; bl: boolean;
begin bl:=false; i:=length(str); for j:=0 to i-1 do begin if str[j] in ['0'..'9'] then begin bl:=ture; break; end; if bl=false then begin result:=strtoint(str); //or result:=strtofloat(str) end; end; end;
strtofloat(string)
var
i,j:integer;
bl: boolean;
begin
bl:=false;
i:=length(str);
for j:=0 to i-1 do
begin
if str[j] in ['0'..'9'] then
begin
bl:=ture;
break;
end;
if bl=false then
begin
result:=strtoint(str); //or result:=strtofloat(str)
end;
end;
end;