Android Question String to Number

franky1852

New Member
Licensed User
Longtime User
Hi guys.
I'm new to the forum and hope that I make no question that has been repeatedly answered.
I try to all examples in the forum but all examples ("1234") work with small numbers.
My Problem:
I have a number from a text box and wont add 100

Dim Str RC As String
Dim IntRC As Int
StrRC = "137215641588"
IntRC = StrRC + 100 'Result 2147483647

Dim StrRC As String
Dim IntRC As Double
StrRC = "137215641588"
IntRC = StrRC + 100 'Result 137215641688E11

Please help me.
 

socialnetis

Active Member
Licensed User
Longtime User
I hadn't tested because I don't have a B4A in this machine, but did you tried using IntRC as Long? Is seems to be a problem related to 32 and 64 bit numbers. Being Int 32bit, Double 64bit for double precision floating point, and Long for 64bit integer numbers.
 
Upvote 0

franky1852

New Member
Licensed User
Longtime User
Thanks socialnetis, as long was the solution.

Dim StrRC As String
Dim IntRC As Long
StrRC = "137215641588"
IntRC = StrRC + 100 'Result 137215641688
 
Upvote 0
Top