pspp-cvs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Pspp-cvs] Changes to pspp/src/data-out.c


From: Ben Pfaff
Subject: [Pspp-cvs] Changes to pspp/src/data-out.c
Date: Tue, 17 May 2005 21:31:02 -0400

Index: pspp/src/data-out.c
diff -u pspp/src/data-out.c:1.17 pspp/src/data-out.c:1.18
--- pspp/src/data-out.c:1.17    Tue May 17 13:53:38 2005
+++ pspp/src/data-out.c Wed May 18 01:30:56 2005
@@ -1116,6 +1116,7 @@
 
   sprintf (buf, "%.*f", decimals, number);
 
+  /* Omit integer part if it's 0. */
   if (!memcmp (buf, "0.", 2))
     memmove (buf, buf + 1, strlen (buf));
   else if (!memcmp (buf, "-0.", 3))
@@ -1215,6 +1216,10 @@
         }
     }
 
+  /* Omit `-' if value output is zero. */
+  if (buf[0] == '-' && buf[strspn (buf, "-.0")] == '\0')
+    memmove (buf, buf + 1, strlen (buf));
+
   buf_copy_str_lpad (dst, fp->w, buf);
   return 1;
 }




reply via email to

[Prev in Thread] Current Thread [Next in Thread]