String value?

Discussion in 'AutoCAD' started by Kieren, May 27, 2004.

  1. Kieren

    Kieren Guest

    Hi.
    Can anyone tell me why this

    (setq ad (strcat (rtos (/ xp 1000) 2 3) " N"))

    should only give me a numeric value (000.000) and not a numeric value suffixed by "N" (000.000 N)?

    Many thanks,
    ..::KIEREN::..
     
    Kieren, May 27, 2004
    #1
  2. Kieren

    ECCAD Guest

    Change to:
    (setq ad (strcat (rtos (/ xp 1000) 2 3)))

    Bob
     
    ECCAD, May 27, 2004
    #2
  3. Kieren

    Kieren Guest

    Thanks Bob, but I actually want the "N" at the end of the numbers, but can't get it to work!!

    ..::KIEREN::..
     
    Kieren, May 27, 2004
    #3
  4. Kieren

    T.Willey Guest

    Kieren,

    Connamd: (setq xp 1)
    Command: (setq ad (strcat (rtos (/ xp 1000) 2 3) " N"))
    "0.000 N"

    It worked for me once I set "xp" to some number.

    Tim
     
    T.Willey, May 27, 2004
    #4
  5. Kieren

    ECCAD Guest

    (if xp
    (setq ad (strcat (rtos (/ xp 1000.0) 2 3) " N"))
    )
    ........
    Would also do it.

    Bob
     
    ECCAD, May 27, 2004
    #5
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.