;; | ---------------------------------------------------------------------------- ;; | ST_FormatStr ;; | ---------------------------------------------------------------------------- ;; | Function : Format an integer or real number as a string and return the ;; | string. If the value passed 'val' is a string, it is returned ;; | as such without any processing. ;; | Argument : 'val' - Value to format (can be either String, Integere or Real) ;; | 'prec' - Precision to use for real numbers ;; | Returns : The string equivalent ;; | Updated : June 11, 2000 ;; | e-mail : rakesh.rao@4d-technologies.com ;; | Web : www.4d-technologies.com ;; | ---------------------------------------------------------------------------- (defun ST_FormatStr( val prec / Str ) (setq Str "") (cond ((= (type val) 'STR) (setq Str val) ) ((= (type val) 'REAL) (setq Str (rtos val (getvar "LUNITS") prec)) ) ((= (type val) 'INT) (setq Str (itoa val)) ) ((= (type val) 'LIST) (setq val (mapcar '(lambda(x) (ST_FormatStr x prec)) val) Str (LI_Lst2Str val ",") ) ) ) Str )