# (distof string \[mode\])
[GstarCAD 2012](../../../Index.md) → [Developer Reference](../../%28Developer%20Reference%29.md) → [AutoLISP Reference](../%28AutoLISP%20Reference%29.md) → [LISP Functions](%28LISP%20Functions%29.md)
<a id="153"></a>
## (distof string \[mode\])
---
"Convert a string to a real number.
---
This function converts a *string* that contains a real number to a real number (**distof** is short for *DIStance TO Floating point*). The **distof** is opposite the [rtos](%28rtos%20number%20-mode%20-precision-%29.md) function. The optional *mode* specifies a number format, like the **rtos** function:
| Mode | Format |
| --- | --- |
| 1 | Scientific. |
| 2 | Decimal. |
| 3 | Engineering: feet and decimal inches. |
| 4 | Architectural: feet and fractional inches. |
| 5 | Fractional. |
### Examples
| Code | Returns |
| --- | --- |
| (**distof** "2.3698E001") | 23.698 |
| (**distof** "2'-5.25\\"" 3\) | 29.25 |
**NOTE** The backslash denotes that there will be a quote within the string. Once LISP sees the second quote, it knows it's the end of the string.
**Tell me about...**
[(atof string)](IDR_LISP_B131.md)
[(atoi string)](%28atoi%20string%29.md)
[LISP Compatibility](../LISP%20Compatibility.md)
[Programming Overview of LISP (LISt Processing) Language](../Programming%20Overview%20of%20LISP%20%28LISt%20Processing%29%20Language.md)
<a id="holding"></a>
## Other versions with matching text
[GstarCAD 2011](../../../../2011/Developer%20Reference/AutoLISP%20Reference/LISP%20Functions/%28distof%20string%20-mode-%29.md)