From 1e2d00ed3a0a89ee7e526016eb13c52f9e4d5afb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Kochma=C5=84ski?= Date: Sun, 10 May 2015 20:13:06 +0200 Subject: [PATCH] format: flonum-to-string: Fix corner-case when printing "0.0". MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit When printing 0.0 and fdigits parameter set to 0 or nil, single "." was printed, what is not valid float number. Now it at least prints ".0". Signed-off-by: Daniel KochmaƄski --- src/lsp/format.lsp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/lsp/format.lsp b/src/lsp/format.lsp index e5cc87663..a5f18c565 100644 --- a/src/lsp/format.lsp +++ b/src/lsp/format.lsp @@ -99,11 +99,11 @@ (declare (type float x)) (cond ((zerop x) ;; Zero is a special case which FLOAT-STRING cannot handle. - (if fdigits + (if (and fdigits (/= fdigits 0)) (let ((s (make-string (1+ fdigits) :initial-element #\0))) (setf (schar s 0) #\.) - (values s (length s) t (zerop fdigits) 0)) - (values "." 1 t t 0))) + (values s (length s) t nil 0)) + (values ".0" 2 t nil 0))) (t (multiple-value-bind (e string) (cond