lenient_parse

Functions

pub fn to_float(text text: String) -> Result(Float, ParseError)

Converts a string to a float.

pub fn to_int(text text: String) -> Result(Int, ParseError)

Converts a string to an integer using a default base of 10.

pub fn to_int_with_base(
  text text: String,
  base base: Int,
) -> Result(Int, ParseError)

Converts a string to an integer with a specified base.

The base must be between 2 and 36 (inclusive), or 0. When the base is set to 0, the base is inferred from the prefix specifier, if one is present. If no prefix specifier is present, base 10 is used.

Search Document