Parsing from string to long

3
Hi, Recently, i have been trying to parse a string (made up of digits) to a long datatype in Mendix (Studio Pro 9.24.2) However, this string is a 17-digit number, and (e.g. 89790517570702123), and I am trying to use the function parseInteger().    Looking at the log messages after the function runs, it appears to have worked. But as this number is a 56-bit number, and integers are usually represented by 32-bits, will this cause problems eventually?
asked
1 answers
0

Hey mate,

 

This will result in an error if the string is too long to convert.

 

I see that someone else has been looking for a solution to a similar problem here: https://forum.mendix.com/link/space/app-development/questions/5059

 

There are some good solutions in the comments, including a workaround to make several smaller integers and combine them or to use a java action as a solution. Perhaps you could start off by testing the length of the string and then use custom logic to handle it where need be.

 

I'm curious as to how you deal with this, keep up updated!

answered