(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 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.