View Full Version : rtos not working...
kyheulon
30-09-2004, 02:44 PM
I'm using the following code and I don't get a number with two decimal places... Why?
(setq a 110.5)
(setq b (rtos a 2 2))
I get b set to "110.5" and I need "110.50". What is worse is when I set "a" to 110, I only get "110" and I need "110.00".
Thanks,
TCARPENTER
01-10-2004, 01:49 PM
rtos is sensitive to the following system variables: UNITMODE, DIMZIN, LUNITS, and LUPREC. Adjust these to reflect what you need and you should see the numbers the way you want to.
HTH
Todd
CarLB
01-10-2004, 09:52 PM
Todd is correct. A dimzin of 8 or 12 would suppress trailing zeros in an rtos conversion. The other settings should not matter as you specified them in the rtos expression.
DIMZIN
Controls the suppression of zeros in the primary unit value. DIMZIN stores this value when you enter it on the command line or set it under Primary Units in the Annotation dialog box. DIMZIN values 0-3 affect feet-and-inch dimensions only.
0 Suppresses zero feet and precisely zero inches
1 Includes zero feet and precisely zero inches
2 Includes zero feet and suppresses zero inches
3 Includes zero inches and suppresses zero feet
4 Suppresses leading zeros in decimal dimensions (for example, 0.5000 becomes .5000)
8 Suppresses trailing zeros in decimal dimensions (for example, 12.5000 becomes 12.5)
12 Suppresses both leading and trailing zeros (for ex-ample, 0.5000 becomes 0.5)
DIMZIN also affects real-to-string conversions performed by the AutoLISP rtos and angtos functions.
vBulletin® v3.7.3, Copyright ©2000-2009, Jelsoft Enterprises Ltd.