+Tue May 17 18:29:35 2005 Ben Pfaff <blp@gnu.org>
+
+ * data-out.c: (format_and_round) Don't output leading `-' if value
+ rounds to zero.
+
Tue May 17 00:06:43 2005 Ben Pfaff <blp@gnu.org>
Fix PR 11119.
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))
}
}
+ /* 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;
}
.50 -1.00 1.00 -1.00 .50 .32
.50 -1.00 1.25 -1.00 .50 .25
.50 -1.00 1.50 -1.00 .50 .21
- .50 .00 .50 -.00 .50 .64
- .50 .00 .75 -.00 .50 .42
- .50 .00 1.00 -.00 .50 .32
- .50 .00 1.25 -.00 .50 .25
- .50 .00 1.50 -.00 .50 .21
+ .50 .00 .50 .00 .50 .64
+ .50 .00 .75 .00 .50 .42
+ .50 .00 1.00 .00 .50 .32
+ .50 .00 1.25 .00 .50 .25
+ .50 .00 1.50 .00 .50 .21
.50 1.00 .50 1.00 .50 .64
.50 1.00 .75 1.00 .50 .42
.50 1.00 1.00 1.00 .50 .32