Hi! I wrote a function that converts a real number to a string, then loops through the string and collects each digit (if it is a digit) into a list.

When I tested this with the number 3.145798437 I discovered that the number seemed to be rounded to 3.1457985.

Is there a maximum of decimal places that OM can handle?

;;; Extracts each digit from a number and adds them to a list

;;; Input: Integer or Real number

;;; Output: List of digits

(lambda (n)

(let ((s (write-to-string n))

(c nil)

(ret '()))

(loop for i below (length s)

do

(setf c (aref s i))

(print c)

(if (digit-char-p c)

(setf ret (append ret (list (digit-char-p c))))))

ret))