parseInt()

Convert the calling string of radix to an Int.

Signature

parseInt(): Int | Null

parseInt(radix: Int): Int | Null

Description

The parseInt() method converts the calling string for radix to a decimal Int.

  • Leading and trailing whitespace and comma separators result in an error.

  • Exponential notation isn’t allowed.

The calling string isn’t changed.

Parameters

Parameter Type Required Description

radix

Int

Value between 2 and 36 that represents the radix of the calling String. Default = 10.

Return value

One of:

Type Description

Int

Value parsed from the calling string.

Null

Unable to parse calling String.

Examples

Convert a value using the default, base 10 radix:

"2147483647".parseInt()
2147483647

Is this article helpful? 

Tell Fauna how the article can be improved:
Visit Fauna's forums or email docs@fauna.com

Thank you for your feedback!