/* Use 'ceil' on the percentage in order to emulate what df itself does. */
snprintf (buf[3], MAX_LEN, "%3.0f%%", ceil (percent));
else
- snprintf (buf[3], MAX_LEN, "%.1f", percent);
+ snprintf (buf[3], MAX_LEN, "%.1f", (double) percent);
cols[3] = buf[3];
#undef MAX_LEN
pr " printf (\"%%s%s: %%c\\n\", indent, %s->%s);\n"
name typ name
| name, FOptPercent ->
- pr " if (%s->%s >= 0) printf (\"%%s%s: %%g %%%%\\n\", indent, %s->%s);\n"
- typ name name typ name;
- pr " else printf (\"%%s%s: \\n\", indent);\n" name
+ pr " if (%s->%s >= 0)\n" typ name;
+ pr " printf (\"%%s%s: %%g %%%%\\n\", indent, (double) %s->%s);\n"
+ name typ name;
+ pr " else\n";
+ pr " printf (\"%%s%s: \\n\", indent);\n" name
) cols;
pr "}\n";
pr "\n";