주말농부님의 서브루틴입니다...
콤마찍기 리습에 있는 서브루틴이져..
(setq txt "123456")
(setq newtxt (cmo_1 txt))
이렇게 해주면... newtext엔...."123,456" 이렇게 천단위마다 콤마가 찍히게 됩니다.
;cmo sub routine
(defun cmo_1(txt / a1 a2 kn txt2)
(setq kn (strlen txt))
(setq txt2 (atof txt))
(if (and (>= txt2 1000)(< txt2 10000))(progn
(setq a1 (substr txt1 1 1))
(setq a2 (substr txt1 2 (- kn 1)))
(setq a3 (strcat a1 "," a2))
))
(if (and (>= txt2 10000)(< txt2 100000))(progn
(setq a1 (substr txt1 1 2))
(setq a2 (substr txt1 3 (- kn 2)))
(setq a3 (strcat a1 "," a2))
))
(if (and (>= txt2 100000)(< txt2 1000000))(progn
(setq a1 (substr txt1 1 3))
(setq a2 (substr txt1 4 (- kn 3)))
(setq a3 (strcat a1 "," a2))
))
a3
)
다음검색
댓글
댓글 리스트-
작성자행복한하루 작성자 본인 여부 작성자 작성시간 07.11.29 조금 틀렸네여..수정좀 해야될꺼 같네염.^^
-
답댓글 작성자행복한하루 작성자 본인 여부 작성자 작성시간 07.11.29 수정되였습니다.^^
-
작성자3:16 작성시간 07.11.29 하루님...수고하셨습니당^^* ㅎㅎㅎ
-
작성자3:16 작성시간 07.11.29 cmo가...중간에 천단위마다 콤마 찍어주는거였꾼요^^* 감사감사^^*
-
작성자주말농부 작성시간 07.11.29 cmx도 함께들어있어요. 콤마 없애는 리습...^^