From: Christophe Rhodes
Subject: format ~d, sign and padding
Date: 
Message-ID: <sq7kwqk52v.fsf@lambda.jesus.cam.ac.uk>
For the call
(format nil "~3,··@d" 5)
clisp, cmucl (and sbcl) return "0+5", while openmcl gives "+05".

If, as I suspect, openmcl is wrong in this case (though the CLHS isn't
explicit on this, it's rather more explicit in the case of ·@f:
"First, leading copies of the character padchar (which defaults to a
space) are printed, if necessary, to pad the field on the left."), is
there an easy way of obtaining "+05" from 5 via format, or do I have
to break it up into two steps, as in 
(let ((x 5)) (format nil "~[-~:;+~]~2,'0d" (signum x) x))? Not that
I'm particularly averse to this, but if there's a ready-made way I
wouldn't mind knowing about it.

Thanks,

Christophe
-- 
Jesus College, Cambridge, CB5 8BL                           +44 1223 510 299
http://www-jcsu.jesus.cam.ac.uk/~csr21/                  (defun pling-dollar 
(str schar arg) (first (last +))) (make-dispatch-macro-character #\! t)
(set-dispatch-macro-character #\! #\$ #'pling-dollar)