format: floats: Fix non-conformity bug regarding output characters.

When width is supplied to format, CLHS 22.3.3.1 Says "Exactly w
characters will be output." This patch fixes this non-conformity to
count separator (".") as well.

Signed-off-by: Daniel Kochmański <dkochmanski@turtle-solutions.eu>
This commit is contained in:
Daniel Kochmański 2015-05-09 12:00:52 +02:00
parent 5536f98294
commit 612b6bb64b

View file

@ -1337,7 +1337,7 @@
(when (and w (or atsign (minusp number))) (decf spaceleft))
(multiple-value-bind
(str len lpoint tpoint)
(sys::flonum-to-string (abs number) spaceleft d k)
(sys::flonum-to-string (abs number) (1- spaceleft) d k)
;;if caller specifically requested no fraction digits, suppress the
;;optional trailing zero
(when (and d (zerop d)) (setq tpoint nil))