• Tries to parse a Float from a String

    Example

    Parse Float

    const f = parseFloat("3.3");
    console.log(f); // 3.3

    Example

    Parse the first valid Float

    const f = parseFloat(" 9.0001e3a");
    console.log(f); // 9000.1

    Returns

    the parsed Float if successful, otherwise undefined

    Parameters

    • str: string

    Returns undefined | number

Generated using TypeDoc