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!

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.

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
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!

CAB

  • Global Moderator
  • Seagull
  • Posts: 10401
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.