Mendix 7 is no longer supported unless you have Extended Support. Mendix 7 documentation will remain available until July 2024.

To upgrade to a supported version, see Moving from Desktop Modeler Version 7 to Studio Pro 8.

Parse integer

Last modified: August 7, 2023

Try to convert a string to a value that is of data type Integer/Long.

parseInteger

Take a string and try to parse it to an Integer/Long.

Input parameters

  • The string to parse Type: String
  • (Optional) Default value Type: Integer/Long

Output

An Integer/Long if it is possible to parse it from the string.

If the string cannot be parsed to an Integer/Long, for example, if the string is not a number or if the parsed value is not within the range of the valid values for an Integer/Long, the default value will be returned. If no default value is provided, an error will occur.

Type: Integer/Long

1
parseInteger('42')

returns:

1
42

with default value:

1
parseInteger('not_an_integer', 42)

returns:

1
42