# TONUMBER

utility · a deepcalc original · no excel equivalent · no sheets equivalent

converts value to number; unparseable text returns default when given, else #VALUE!

## signature

```
TONUMBER(text, [default_value])
```

returns: `number`

## arguments

- text: text: required
- default_value: number: optional, defaults to 0

## examples

formula and result, asserted in the engine test suite.

| formula | result | with |
| --- | --- | --- |
| `=TONUMBER("123.45")` | `123.45` | none |
| `=TONUMBER(A1, 0)` | `10` | A1=10 |

## errors

error values observed from the engine: each with a call that produces it.

| error | produced by |
| --- | --- |
| `#VALUE!` | `=TONUMBER("alpha")` |

## related

- [FROMBYTES](https://deepcalc.com/docs/functions/frombytes.md): converts byte array to integer
- [GENERATEID](https://deepcalc.com/docs/functions/generateid.md): generates unique ID with prefix and random suffix
- [HASH](https://deepcalc.com/docs/functions/hash.md): hex digest of text: SHA256 (default, FIPS 180-4) or MD5 (RFC 1321)
- [IMAGE](https://deepcalc.com/docs/functions/image.md): shows an image from a url: the browser loads it, the engine does not fetch
- [ISIN](https://deepcalc.com/docs/functions/isin.md): checks if value is in a range or comma-separated list
- [RANDOMCHOICE](https://deepcalc.com/docs/functions/randomchoice.md): random pick from a range (with replacement); count > 1 spills a column
- [RANDOMINT.UNIQUE](https://deepcalc.com/docs/functions/randomint-unique.md): generates unique random integers in range
- [RANDOMNORMAL](https://deepcalc.com/docs/functions/randomnormal.md): generates random values from normal distribution

## navigate

- [all utility functions](https://deepcalc.com/docs/functions/utility-functions.md)
- [function index](https://deepcalc.com/docs/functions.md): all 602 functions
- [error values](https://deepcalc.com/docs/errors.md) · [concepts](https://deepcalc.com/docs/concepts.md) · [limits](https://deepcalc.com/docs/limits.md)
- [everything in one file](https://deepcalc.com/llms-full.txt)

source: https://deepcalc.com/docs/functions/tonumber