> For clean Markdown of any page, append .md to the page URL. > For a complete documentation index, see https://docs.itential.com/itential-platform/6/studio/tasks/reference/parse-int/llms.txt. > For AI client integration (Claude Code, Cursor, etc.), connect to the MCP server at https://docs.itential.com/_mcp/server. # parseInt > Use the parseInt task to parse a string value and return an integer using the decimal number system as a base. The `parseInt` task parses a string value and returns an integer (number) value using the decimal number system as a mathematical base. Only the first number in the string is returned. If the string argument is not a string, it is converted to a string using the ToString abstract operation. Leading whitespace in the string is ignored. ## Potential use case This task is useful when you need to convert a number represented as a string into an integer. For example, if your data string contains a decimal value such as `"1.655"`, `parseInt` will convert the decimal value to the rounded number `1`, and the digits that follow the decimal will be truncated. ## Properties | Input | Type | Description | | ------- | ------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | `str` | String | Required. The string value to parse and return as a number. | | `radix` | Number | Optional. Represents the numerical system used to convert `str` to an integer. This can be a value between 2 and 36. If no radix is provided, the default will be 10 (decimal). | | Output | Type | Description | | -------- | ------ | ------------------------------------------------------------------------------------------------------------------------------------------- | | `result` | Number | The number that returns when the input `str` is parsed. If the first character cannot be converted to a number, the `result` returns `NaN`. | ## Example 1 In this example: * The incoming string variable `str` is statically set to `0xF`, which is a hexadecimal representation. * The `radix` number is set to `16`, which is a hexadecimal number. ![](/_fern-img/9f7109fc1d549b86633f8e85efdd69e2c0239114cb6546343a3ecef6664025ea.webp) The `result` of the outgoing variable is `15`. ![](/_fern-img/b404e67c9c1fa42f81a78d6ebc4e78b4efc98447c33a2501bb759f62172fd12b.webp) ## Example 2 In this example: * The incoming string variable `str` is statically set to `02019 4 29`. Notice the white spaces within the reference variable. * No `radix` number is provided, so the default decimal value (`10`) is used. ![](/_fern-img/bcc40a1bd1cb68d127e67408488ce6dd1a1edd1c7f225b9e128e77f60d86478f.webp) The `result` of the outgoing variable is `2019`. ![](/_fern-img/aed737597a280697f9b5896295936b4af01fc7f31208457b1bd5b988b580fd02.webp) ## Example 3 In this example: * The incoming string variable `str` is statically set to `5.99`. * No `radix` number is provided, so the default decimal value (`10`) is used. ![](/_fern-img/08b5f0d0ed001edb075bc9704d393caadc040f80fe2c39279634553b420691e3.webp) The `result` of the outgoing variable is `5`. The numbers after the decimal are truncated. ![](/_fern-img/d824d7b7148f9fe248b108d13dba75027dd52a84acd6a96be0870ab1d58cf823.webp) ## Example 4 In this example: * The incoming string variable `str` is statically set to `7,123`. Notice the value contains a comma. * No `radix` number is provided, so the default decimal value (`10`) is used. ![](/_fern-img/5d6004f2da1dd6d7b63c8ba54df8334a71d9f9a61907d9f33303f6d66c6f7d8d.webp) The `result` of the outgoing variable is `7`. The numbers after the comma are truncated. ![](/_fern-img/dc0668682fa6e7c0166f77f0bd4cd59f78bcf21384c824e5fb95b12c4f04ea6b.webp) ## Example 5 In this example: * The incoming string variable `str` is set to `20*4`. Notice the operator (asterisk) within the reference variable. * No `radix` number is provided, so the default decimal value (`10`) is used. ![](/_fern-img/f82732a53cbb69f20b461056255251c61e843da978f9bab219950cfcb9c78eac.webp) The `result` of the outgoing variable is `20`. ![](/_fern-img/81853c40a8b4d3bb5b683ccaa6448fb105fe453e4f7224c30e5ee48a8ea92d65.webp) > Use the parseInt task to parse a string value and return an integer using the decimal number system as a base.