WOW! It's amazing. I just come back from a buzy time.
Thanks to everyone.
This is my proposal:
(setq UserInput (getreal "\nEnter the number: "))
(if (UserInput is an integer)
(Option 1 ...)
(progn (Get_Number_of_Decimal) ;;; if the input is a real"
(Option 2 ...)
)
)
Kerry, hope your football term wins next time.
NICK_VNV & CAD, your codes are simple and straightforward.
(setq a (getreal "\nEnter the number: "))
(if (> (rem a 1) 0)
(setq typ "REAL")
(setq typ "INT")
)
(princ (strcat "\nEntered type is " typ))
(princ)
;; get precision of a decimal number string including trailing zeros
(defun getPrec (str)
(if (vl-string-search "." str)
(- (strlen str)(vl-string-search "." str) 1)
0
)
)
gile, your are so smart!
Lee, you always think something different from others.
You did not waste your time. I can learn from your ideas.
Thanks to swamp people.