string.parseDouble()

Convert a String to a Double.

Signature

parseDouble() => Number | Null

Description

Converts the calling String to a numeric Double.

The calling String isn’t changed.

Limitations

  • Leading and trailing whitespace are allowed.

  • Exponential notation is allowed.

  • Comma separators aren’t allowed.

Parameters

None

Return value

One of:

Type Description

Number

Double parsed from the calling string.

Null

Unable to parse calling String.

Examples

  1. Convert a simple numeric value:

    "2147483647".parseDouble()
    2.147483647E9
  2. Convert a value represented in exponential notation:

    "1.7976931348623158e308".parseDouble()
    1.7976931348623157e+308
\