strlen or length

Discussion in 'AutoCAD' started by caduser, Jul 14, 2003.

  1. caduser

    caduser Guest

    (setq x (car xx))
    return 10.5689
    how to count that number
    they have 6 number (qty w/o dot)
     
    caduser, Jul 14, 2003
    #1
  2. caduser

    Joe Burke Guest

    Should consider negative numbers.

    (defun Len (n / ln)
    (setq ln (strlen (vl-princ-to-string (abs n))))
    (if (= 'REAL (type n))
    (1- ln) ln)
    )

    Joe Burke
     
    Joe Burke, Jul 14, 2003
    #2
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.