# text2num proc

Source: https://ref.dm-lang.org/proc/text2num

### Format
- `text2num(T)`
- `text2num(T, radix)`


### Args
- `T`: A text string.
- `radix`: The radix/base of the number, e.g. 16 for hexadecimal


### Returns
> A number.

If T is a text string for a number, return the number. Any non-numeric text following the initial portion will be ignored. If there is no initial numeric portion, the result is null.

```dm /text2num/
var/number = text2num("123")  // = 123
```

The optional radix, which defaults to 10, can be any integer from 2 to 36.

### See also
- [istext proc](https://ref.dm-lang.org/proc/istext.md)
- [num2text proc](https://ref.dm-lang.org/proc/num2text.md)
