commit a55e2fe55089ef40726e1d351a94ac62617d5182
parent e7c2240215c4c4d83bb1a1bc6b243585eb24b6fb
Author: Claudio Alessi <smoppy@gmail.com>
Date: Tue, 26 Jan 2016 23:49:43 +0100
Zero-pad to 2 digits.
Diffstat:
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/snore.c b/snore.c
@@ -73,7 +73,7 @@ time_print(double tm) {
for(i = LENGTH(symbols) - 1; i >= 0; --i) {
piece = tm / symbols[i].mult;
- snprintf(buf, sizeof buf, "%f", piece);
+ snprintf(buf, sizeof buf, "%09f", piece);
p = strrchr(buf, '.');
if(symbols[i].precision)
p += 1 + symbols[i].precision; /* truncate */