Check out v4 of the Fauna CLI

v4 of the Fauna CLI is now in beta.

The new version introduces enhancements to the developer experience, including an improved authentication workflow. To get started, check out the CLI v4 quick start.

string.parseInt()

Convert a String to a Int.

Signature

parseInt() => Number | Null

parseInt(radix: Number) => Number | Null

Description

Converts the calling String to a numeric Int.

The calling String isn’t changed.

Limitations

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

  • Exponential notation isn’t allowed.

Parameters

Parameter Type Required Description

radix

Number

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

Return value

One of:

Type Description

Number

Int 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!