query
On this page

toIntBase10

lib.toIntBase10

Docs pulled from | This Revision | 8 minutes ago


Parse a string as a base 10 int. This supports parsing of zero-padded integers.

Inputs

str
A string to be interpreted as an int.

Type

toIntBase10 :: string -> int

Examples

lib.strings.toIntBase10 usage example

toIntBase10 "1337"
=> 1337

toIntBase10 "-4"
=> -4

toIntBase10 " 123 "
=> 123

toIntBase10 "00024"
=> 24

toIntBase10 "3.14"
=> error: floating point JSON numbers are not supported
(lib.strings.toIntBase10)

Noogle detected

Aliases