Welcome,
Guest
. Please
login
or
register
.
1 Hour
1 Day
1 Week
1 Month
Forever
Login with username, password and session length
News:
Home
Help
Login
Register
TheSwamp
»
Code Red
»
AutoLISP (Vanilla / Visual)
»
Topic:
Rtos function
« previous
next »
Print
Pages: [
1
] |
Go Down
Author
Topic: Rtos function (Read 1795 times)
0 Members and 1 Guest are viewing this topic.
ozimad
Guest
Rtos function
«
on:
July 03, 2010, 06:26:33 AM »
I have two codes: I want them to give me string like "5.36" (in aa1) and "5.30" (in aa2).
But in aa2 i get "5.3" whats the problem?
(defun c:aa1 ()
(print (rtos (+ 2.365256154 3) 2 2))
)
(defun c:aa2 ()
(print (rtos (+ 2.3 3) 2 2))
)
Thanks!
Logged
Kerry
Mesozoic relic
Seagull
Posts: 11654
class keyThumper<T>:ILazy<T>
Re: Rtos function
«
Reply #1 on:
July 03, 2010, 06:37:32 AM »
What is your DIMZIN variable setting ??
DIMZIN affects real-to-string conversions by
rtos
and
angtos
functions.
Logged
kdub, kdub_nz in other timelines.
Perfection is not optional.
Everything will work just as you expect it to, unless your expectations are incorrect.
Discipline: None at all.
Kerry
Mesozoic relic
Seagull
Posts: 11654
class keyThumper<T>:ILazy<T>
Re: Rtos function
«
Reply #2 on:
July 03, 2010, 06:54:08 AM »
There are several solutions on this site ..
Here's one
http://www.theswamp.org/index.php?topic=4747.msg57268#msg57268
Logged
kdub, kdub_nz in other timelines.
Perfection is not optional.
Everything will work just as you expect it to, unless your expectations are incorrect.
Discipline: None at all.
ozimad
Guest
Re: Rtos function
«
Reply #3 on:
July 03, 2010, 07:01:25 AM »
Yes!
(setvar "DIMZIN" 0)
And all works nice.
Thanks a lot Kerry!
Logged
CAB
Global Moderator
Seagull
Posts: 10401
Re: Rtos function
«
Reply #4 on:
July 03, 2010, 07:51:45 AM »
And some more rounding
http://www.theswamp.org/forum/index.php?topic=3076.0
http://www.theswamp.org/index.php?topic=8511.msg109002#msg109002
very cool link about rounding
http://en.wikipedia.org/wiki/Rounding#Round-to-even_method
Logged
I've reached the age where the happy hour is a nap. (°¿°)
Windows 10 core i7 4790k 4Ghz 32GB GTX 970
Please support this web site.
Print
Pages: [
1
] |
Go Up
« previous
next »
TheSwamp
»
Code Red
»
AutoLISP (Vanilla / Visual)
»
Topic:
Rtos function