## TO_DOUBLE

TO_DOUBLE function converts an input value to a double value. If the input parameter is of a date type, its value will be interpreted as milliseconds since the Unix epoch, converted to double. Boolean true will be converted to double 1.0, false to 0.0.

### Examples

Here are a couple of examples of how to use the `TO_DOUBLE` function in ES|QL:

```esql
ROW str1 = "5.20128E11"
| EVAL dbl = TO_DOUBLE("520128000000"), dbl1 = TO_DOUBLE(str1)
```

In this example, the string "5.20128E11" is converted to a double value.

```esql
ROW str2 = "foo"
| EVAL dbl2 = TO_DOUBLE(str2)
```

In this example, the string "foo" cannot be converted to a double value, resulting in a null value. A warning header is added to the response indicating the source of the failure.