0.5 >> 1/2

Discussion in 'AutoCAD' started by Adesu, Aug 6, 2004.

  1. Adesu

    Adesu Guest

    Dear Alls,how to fix input from user,I want 0.5 become 1/2,thanks.

    _$ (setq pscal (getreal "\nENTER PAPER SCALE [1/1 1/2 1/3 ... etc]: " ))
    0.5
    _$
     
    Adesu, Aug 6, 2004
    #1
  2. Adesu

    BillZ Guest

    Rtos has a fractional mode:

    Command: (rtos 0.5 5)
    "1/2"

    Why not use keywords?

    (initget 1 "1/3 1/2 2/3")
    (getkword "\nSelect paper size < 1/3 1/2 2/3 > ")

    this will limit the choices.


    Bill
     
    BillZ, Aug 6, 2004
    #2
  3. Adesu

    Jon Guest

    (rtos pscal 4)

    Jon
     
    Jon, Aug 6, 2004
    #3
  4. Adesu

    Adesu Guest

    I've got it,with;
    (setq pscal
    (getstring "\nENTER PAPER SCALE [1/1 1/2 1/3 ... etc]: " ))

     
    Adesu, Aug 9, 2004
    #4
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
There are no similar threads yet.
Loading...