;; rtosta by ymg September 2013 ;
;; ;
;; Arguments: sta Real number to format as a Station ;
;; unit 1 for Imperials, ;
;; 2 for Metrics. ;
;; prec Integer for number of decimals ;
;; ;
;; Examples: (rtosta 0 1 0) -> "0+00" (rtosta 1328.325 1 2) -> "13+28.33" ;
;; (rtosta 0 2 0) -> "0+000" (rtosta 1328.325 2 2) -> "1+328.33" ;
;; ;
;; If sta is negative, format is as follow: ;
;; (rtosta -1328.325 1 2) -> "13-28.33" ;
;; (rtosta -1328.325 2 2) -> "1-328.33" ;
;; ;
(defun rtosta
(sta unit prec
/ str a b
) (while (< (strlen str
) (if (= prec
0) (+ unit
2) (+ prec
(+ unit
3)))) )
)
)
;; statof by ymg September 2013 ;
;; ;
;; Argument: String in format of a Station. ;
;; ;
;; Examples: (statof "0+00") -> 0.0 (statof "13+28.33") -> 1328.33 ;
;; (statof "1+328.33") -> 1328.33 ;
;; ;
;; If sta is negative, format is as follow: ;
;; (statof "13-28.33") -> -1328.33 ;
;; (statof "1-328.33") -> -1328.33 ;
;; ;
)
)