06-22-2018, 12:47 PM

Hi,

I've been struggling with this and I am sure there must be a simple solution I am just missing.

When converting a string of digits to an integer, if the converted integer is greater than 2147483647 the resulting integer is a negative number. I realize this has to do with the limit of a type 'int', but I can't understand what type to use to get a value that can than be used in equations. I typed with type LONG but I get the same result as type INT.

Example.

str text="2561214621"

int sVal=val(text)

out sVal

-1733752675 (need this to be 2561214621 or in some other notation that can be used in calculations)

this works fine:

str text="2023292291"

int sVal=val(text)

out sVal

2023292291

My overall problem is that the string could be a string of digits from 0 to 10,000,000,000 and I need to make calculations on the converted numbers.

Any help is greatly appreciated.

Jim

I've been struggling with this and I am sure there must be a simple solution I am just missing.

When converting a string of digits to an integer, if the converted integer is greater than 2147483647 the resulting integer is a negative number. I realize this has to do with the limit of a type 'int', but I can't understand what type to use to get a value that can than be used in equations. I typed with type LONG but I get the same result as type INT.

Example.

str text="2561214621"

int sVal=val(text)

out sVal

-1733752675 (need this to be 2561214621 or in some other notation that can be used in calculations)

this works fine:

str text="2023292291"

int sVal=val(text)

out sVal

2023292291

My overall problem is that the string could be a string of digits from 0 to 10,000,000,000 and I need to make calculations on the converted numbers.

Any help is greatly appreciated.

Jim