> ## Documentation Index
> Fetch the complete documentation index at: https://docs.e6data.com/llms.txt
> Use this file to discover all available pages before exploring further.

# TRY_TO_NUMBER

> Parses a string as a number and returns NULL if parsing fails.

<div className="e6-meta"><span className="e6-eyebrow e6-eyebrow--quiet">Scalar function</span></div>

NULL input, an empty/unparseable string or a failed supported conversion returns NULL.

## Syntax

### Scalar

```sql theme={"theme":{"light":"github-light","dark":"github-dark"}}
try_to_number(value)
```

## Arguments

| Name | Type | Required | Description |
| - | - | - | - |
| value | STRING | Yes | Text representing a number. |

## Returns

* Type: DOUBLE
* NULL behavior: NULL input, an empty/unparseable string or a failed supported conversion returns NULL.

## Properties

| Property | Value |
| - | - |
| Deterministic | Yes |
| Supports window usage | No |
| Exact result | Partial (The output is floating-point DOUBLE and can round decimal values.) |

## Usage notes

* Deterministic: The same inputs and settings produce the same result.

## Examples

### Typical behavior

```sql theme={"theme":{"light":"github-light","dark":"github-dark"}}
SELECT try_to_number('3.5') AS "value", try_to_number('bad') AS invalid;
```

| value | invalid |
| - | - |
| 3.5 | NULL |

### Negative and fractional text

```sql theme={"theme":{"light":"github-light","dark":"github-dark"}}
SELECT try_to_number('-12.50') AS negative_number, try_to_number('0.25') AS fraction;
```

| negative\_number | fraction |
| - | - |
| -12.5 | 0.25 |

## Limitations

* Only the one-argument form is implemented. Format, precision and scale arguments are rejected.

## Related functions

* [try\_cast](/query/sql/functions/conditional/try_cast)


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.