프로그램
캐드 분류

사칙연산 리습 질문 드립니다.

컨텐츠 정보

본문

안녕하세요, 처음 질문을 올려보내요.. 

첨부 파일은 제가 쓰고있는 사칙연산 리습입니다. 
더하기, 곱하기는 소수점 둘째자리까지 나오는데
빼기와 나누기는 소수점이 없습니다… 
고수님들의 답변 부탁드립니다. 감사합니다!
(전체중 일부,, 문제라고 생각되는 부분..)
   );repeat
    ;————————–output
    (if (or(= cal "A") (= cal "D"))
      (progn
       (princ "ninsertion text point")  
       (command "text" "\" "" (rtos ot1 2 2))
       (princ (strcat "n계산결과<" tx ">: "  (rtos ot1) " (" (rtos i) "개 합)"))
      )
       (princ)
    )
    (if (= cal "B")
     (progn
      (if (< ot1 0)
       (setq ot1 (substr (rtos ot1) 2))
       (setq ot1 (strcat "-" (rtos ot1)))
      )      
       (princ "ninsertion text point")   
       (command "text" "\" "" ot1)
       (princ (strcat "n계산결과<" tx ">: " ot1))
     )
       (princ)
    )
    (if (= cal "C")
     (progn
      (setq ot1 (/ 1.0 ot1))
      (princ "ninsertion text point")  
      (command "text" "\" "" (rtos ot1))
      (princ (strcat "n계산결과<" tx ">: " (rtos ot1)))
     )
      (princ)

관련자료

댓글 1 / 1 페이지

상큼메론90님의 댓글

emoticon

리습 내용중

 (command "text" "\" "" (rtos ot1 2 2))  (princ (strcat "n계산결과<" tx ">: "  (rtos ot1) " (" (rtos i) "개 합)"))

rtos 로 시작되는 함수 맨 뒤자리 빨간색이 소숫점 자리 입니다. 그 밑에줄에는 없죠? rtos 로 시작되는 함수 모두 위에처럼 고쳐주시면 됩니다.

for example (rtos ot1)   ->   (rtos ot1 2 2) 

.

전체 78 / 3 페이지
번호
제목
이름

최근글


새댓글


알림 0