Reputation: 1232
I have a list of integers (3 11 7 26 5)
I wrote a function to prepend 0 to 1-digit numbers:
(defun beautify (list)
(mapcar #'0-add list))
(defun 0-add (1digit)
(format nil "~2,'0d" 1digit))
it outputs ("03" "11" "07" "26" "05")
However, I'd like to have (03 11 07 26 05)
How can I arrange it?
Upvotes: 3
Views: 233
Reputation: 139311
CL-USER 10 > (format t "(~{~a~^ ~})" '("03" "11" "07" "26" "05"))
(03 11 07 26 05)
CL-USER 11 > (format t "(~{~2,'0d~^ ~})" '(3 11 7 26 5))
(03 11 07 26 05)
Upvotes: 6