#include "str.h"
#include "var.h"
+#include "gettext.h"
+#define _(msgid) gettext (msgid)
+
#include "debug-print.h"
\f
/* Public functions. */
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;
}