Function Entry: RTOS
← Prev | ↑ Chapter | Next → | Index | Symbols
Function Entry: RTOS
Name
rtos
Class
Conversion Function
Syntax
(rtos number [mode [precision]])
Arguments and Values
number: numbermode: optional conversion modeprecision: optional precision
Description
Converts a real or number to a string according to AutoCAD formatting conventions.
Return Values
String.
Side Effects
None.
Affected By
- numeric formatting settings
- conversion mode and precision
Compatibility
This function is part of the language/host formatting boundary, not purely a generic printer primitive.
Notes
- Autodesk documents the accepted
modevalues as the linear-unit formats corresponding toLUNITS:1scientific2decimal3engineering4architectural5fractional
- If
modeandprecisionare omitted, Autodesk documents thatrtosuses the currentLUNITSandLUPRECsettings. - Autodesk documents that the resulting string is affected by
UNITMODEfor engineering, architectural, and fractional output, and byDIMZINfor zero suppression. - Locale insensitivity (normative).
rtosalways uses.as the decimal separator regardless of the host's `LCNUMERIC` /LANG/ `LCALL` environment, regardless of the OS-level locale, and regardless of theDIMDSEPsystem variable.DIMDSEPcontrols only the dimension-text renderer (see § System Variable Entry: DIMDSEP), not the AutoLISP numeric printer. The complementary(atof)rejects locale- comma input the same way — see the(atof "3,5") -> 3.0probe in § atof. clautolisp matches this contract end-to-end: the value printer (autolisp-value->string, princ / prin1 / vl-*-to-string) is also locale-insensitive —(vl-princ-to-string 3.14)is"3.14"on every locale, every host. User code that wants a comma-separator UI does the substitution itself; the AutoLISP runtime stays in.-land so that(atof (rtos n))round-trips on every machine.
Availability
- AutoCAD 2026: documented (per Autodesk reference page).
- BricsCAD V26: presumed compatible (no contradicting page found).
- Status: AutoCAD documented; BricsCAD presumed-both pending Phase 4 verification.
Source Notes
- [rtos (AutoLISP)](https://help.autodesk.com/cloudhelp/2018/ENU/AutoCAD-AutoLISP-Reference/files/GUID-D03ABBC2-939A-44DB-8C93-FC63B64DE4A2.htm)
- [About String Conversions (AutoLISP)](https://help.autodesk.com/cloudhelp/2026/PLK/AutoCAD-AutoLISP/files/GUID-A38E30D4-684E-44FA-A910-E08522876414.htm)