;;;Subroutine to convert a real no into a station string. If m_units=T then string is metric. ;;; ;;; Author: ;;; Henry C. Francis ;;; 425 N. Ashe Street ;;; Southern Pines, NC 28387 ;;; ;;; http://www.pinehurst.net/~pfrancis ;;; e-mail hfrancis@pinehurst.net ;;; All rights reserved. ;;; (defun stait (areal staprec /) ; (if staprec nil (setq staprec 1)) ;(princ "\nReal = ") ;(princ real) ;(princ "\nprecision = ") ;(princ staprec) (if m_units (progn (setq stanum (atof (rtos areal 2 staprec)) stahun (fix (/ stanum 1000)) starem (- stanum (* stahun 1000)) ) ;_ end of setq (strcat (itoa stahun) (if(< stanum 0) "-" "+") (if (and (<(abs starem)100) (>(abs starem)9)) (strcat "0" (rtos starem 2 staprec)) (if (<(abs starem)10) (strcat "00" (rtos (abs starem) 2 staprec)) (rtos (abs starem) 2 staprec) ) ;_ end of if ) ;_ end of if ) ;_ end of strcat ) ;_ end of progn (progn (setq stanum (atof (rtos areal 2 staprec)) stahun (fix (/ stanum 100)) starem (- stanum (* stahun 100)) ) ;_ end of setq (strcat (itoa stahun) (if(< stanum 0) "-" "+") (if (<(abs starem)10) (strcat "0" (rtos (abs starem) 2 staprec)) (rtos (abs starem) 2 staprec) ) ;_ end of if ) ;_ end of strcat ) ;_ end of progn ) ;_ end of if ) ;_ end of defun ;|«Visual LISP© Format Options» (72 2 40 2 T "end of " 60 9 0 0 0 T T nil T) ***Don't add text below the comment!***|;