Skip to main content
parseint(str, base) converts the string representation of an integer to a number. base specifies the numeric base: 10 for decimal, 16 for hexadecimal, 2 for binary, and so on. The base must be between 2 and 62 inclusive.

Signature

Example

Read a replica count from an environment variable and use it in a deployment command:
env returns a string. parseint converts it to a number so it can be used in numeric contexts or validated with min and max.

Notes

  • base must be a whole number between 2 and 62 inclusive.
  • If the string is not a valid integer in the given base, Errand reports an error at evaluation time.
  • The result is always an integer. Decimals are not parsed by parseint.