From 612b6bb64bb796a3ce6479ff06ed78f518e373bc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Kochma=C5=84ski?= Date: Sat, 9 May 2015 12:00:52 +0200 Subject: [PATCH] format: floats: Fix non-conformity bug regarding output characters. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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 --- src/lsp/format.lsp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/lsp/format.lsp b/src/lsp/format.lsp index c8a37df7f..f4e710447 100644 --- a/src/lsp/format.lsp +++ b/src/lsp/format.lsp @@ -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))