rtos
(rtos value [format [precision]])
The rtos function converts a floating-point value to a string, depending on the specifications supplied in the arguments format for the unit conversion mode and precision for the number of decimal points.
The value given in format is interpreted as follows:
Value |
Format |
Example |
-1 |
The current value of the local system variable LUNITS (Linear Units) is used, which can contain one of the following settings (1 to 5). |
|
1 |
Scientific representation |
1.235E2 |
2 |
Decimal |
123.5 |
3 |
English: Engineering (feet/inches) |
10'-3.5" |
4 |
English: Architectural (feet/fractional inches) |
10'-3 1/2" |
5 |
English: Fractional |
123 1/2 |
Note: The distof function can accurately reconvert a string returned by the rtos function, and vice versa.
: (rtos 123.50)
"123.50"
: (rtos 123.50 1)
"1.235E+02"
: (rtos 123.50 2)
"123.50"
: (rtos 123.50 3)
"10'-3.50\""
: (rtos 123.50 4)
"10'-3 1/2\""
: (rtos 123.50 5)
"123 1/2"
distof