dropping "0"

Discussion in 'AutoCAD' started by TCEBob, Oct 11, 2004.

  1. TCEBob

    TCEBob Guest

    Here's a snippet:

    Command: (rtos 1.0000 2 3)
    "1"

    Why won't rtos return trailing 0s? Or will it if I set something somewhere?

    For now the following kluge:

    Command: (vl-string-right-trim "1" (rtos(+ 1 0.0001) 2 4))
    "1.000"

    Which is pretty ugly but it works.

    rs
     
    TCEBob, Oct 11, 2004
    #1
  2. TCEBob

    MP Guest

    check dimzin?
    hth
    Mark
     
    MP, Oct 11, 2004
    #2
  3. TCEBob

    MP Guest

    nope, sorry
    (defun test()
    (print(rtos 1.0000 2 3))
    (setvar "dimzin" 0)
    (print (rtos 1.0000 2 3))
    (setvar "dimzin" 1)
    (print(rtos 1.0000 2 3))
    (setvar "dimzin" 2)
    (print(rtos 1.0000 2 3))
    )

    $ (TEST)

    "1.000"
    "1.000"
    "1.000"
    "1.000" "1.000"
    _$

    so it's something else
    ....hmmm...
     
    MP, Oct 11, 2004
    #3
  4. TCEBob

    MP Guest

    weird...
    I remember seeing posts recently about trailing zeros and what had stuck in
    memory was dimzin
    now I can't get dimzin or luprec or lunits to eliminate trailing zeros from
    rtos
    ???
    must be in there somewhere
     
    MP, Oct 11, 2004
    #4
  5. if its set to 8 or more it will drop the trailing zeros

    "MP" <>
    |>weird...
    |>I remember seeing posts recently about trailing zeros and what had stuck in
    |>memory was dimzin
    |>now I can't get dimzin or luprec or lunits to eliminate trailing zeros from
    |>rtos
    |>???
    |>must be in there somewhere

    James Maeding
    jmaeding at hunsaker dot com
    Civil Engineer/Programmer
     
    James Maeding, Oct 12, 2004
    #5
  6. TCEBob

    TCEBob Guest

    Right you are. Help for dimzin also says that it affects rtos and angtos. So now
    I have to save, change and restore dimzin. (Since I don't want trailing 0s in
    dimensions.)

    rs
     
    TCEBob, Oct 12, 2004
    #6
Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments (here). After that, you can post your question and our members will help you out.
Similar Threads
Loading...