wimal Posted September 22, 2016 Posted September 22, 2016 (setq a 12.2) (setq b 7. (setq c (+ a b)) (alert (rtos c)) This display 20 How to change this to display as 20.0 Quote
Grrr Posted September 22, 2016 Posted September 22, 2016 My 2 cents: _1$ (setq a 12.2) 12.2 _1$ (setq b 7. 7.8 _1$ (setq c (+ a b)) 20.0 _1$ (rtos c) "20.0000" _1$ (getvar 'lunits) 2 _1$ (getvar 'luprec) 4 _1$ (setvar 'luprec 1) 1 _1$ (rtos c) "20.0" _1$ or just: _1$ (rtos c) "20.0000" _1$ (rtos c (getvar 'lunits) 1) "20.0" _1$ Quote
BIGAL Posted September 22, 2016 Posted September 22, 2016 Look at rtos function help (rtos c 2 1) (Rtos number mode precision) 1 scientific 2 Decimal 3 Feet decimal inches 4 Feet fraction inches 5 Fractional Quote
Lee Mac Posted September 22, 2016 Posted September 22, 2016 Be aware of the effect of DIMZIN on the result; my Consistent rtos function is a possible solution to counter this effect. Quote
wimal Posted September 23, 2016 Author Posted September 23, 2016 Thanks Mr Lee Mac. Your explanation is very useful. Please can you explain me what function create the _$ and _1$ Quote
Lee Mac Posted September 23, 2016 Posted September 23, 2016 Thanks Mr Lee Mac. Your explanation is very useful. You're welcome! Please can you explain me what function create the _$ and _1$ This is the Visual LISP IDE Console prompt - see here for more information: The Visual LISP Editor - Part 1 The Visual LISP Editor - Part 2 An Introduction to the Visual LISP IDE Retrieving Information About a Function A Shortcut to Localising Variables Debugging Code with the Visual LISP IDE Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.