I can't convert this string to numerical value. Is there any way to do it ?

error - '44849848974575' is not a valid integer value

........

begin

showmessage(inttostr(strtoint('44849848974575' )));

end;

error - '44849848974575' is not a valid integer value

........

begin

showmessage(inttostr(strto

end;

Experts Exchange Solution brought to you by

Enjoy your complimentary solution view.

Get every solution instantly with Premium.
Start your 7-day free trial.

I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

function strtoint2(s:string):int64;

var i,len:longint;

res:int64;

lame:array[1..30] of int64;

function exp(x,n:int64):int64;

var y:int64;

i:longint;

begin

y:=x;

for i:=1 to n-1 do

begin

y:=y*x;

end;

result:=y;

end;

begin

for i:=1 to 30 do

begin

lame[i]:=(exp(10,i)) div 10;

end;

len:=length(s); res:=0;

for i:=1 to len do

begin

res:=res+(lame[i]*strtoint

end;

result:=res;

end;

function inttostr2(n:int64):string;

var i:longint;

point,help:int64;

res:string;

stop:boolean;

lame:array[1..30] of int64;

function exp(x,n:int64):int64;

var y:int64;

i:longint;

begin

y:=x;

for i:=1 to n-1 do

begin

y:=y*x;

end;

result:=y;

end;

begin

for i:=1 to 30 do

begin

lame[i]:=(exp(10,i)) div 10;

end;

stop:=false;

for i:=1 to 30 do

begin

if stop=false then

begin

if ((n / lame[i] ) >= 1) and ((n / lame[i] ) < 10) then

begin

stop:=true;

point:=i;

end;

end;

end;

res:='';

while n > 1 do

begin

res:=res+inttostr(trunc(n/

help:=((trunc (n/lame[point]))*lame[poin

n:=n-help;

dec(point);

end;

result:=res;

end;

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
Delphi

From novice to tech pro — start learning today.

Experts Exchange Solution brought to you by

Enjoy your complimentary solution view.

Get every solution instantly with Premium.
Start your 7-day free trial.

function strtoint2(s:string):cardin

var i,len,res:word;

lame:array[1..15] of cardinal;

function mocnina(a,i:word):cardinal

var b:cardinal;

x:word;

begin

b:=a;

for x:=1 to i-1 do

begin

b:=b*a;

end;

result:=b;

end;

begin

for i:=1 to 15 do // rad

begin

lame[i]:=(mocnina(10,i)) div 10;

end;

len:=length(s);

res:=0;

for i:=1 to len do

begin

res:=res+(lame[i]*strtoint

end;

result:=res;

end;