Commit 3fce32f494f9bdc37b29ddb03a5742260b8ab44c

ckolivas 2012-10-17T10:33:22

Use 3 significant digits when suffix string is used and values are >1000.

1
2
3
4
5
6
7
8
9
10
11
12
13
diff --git a/cgminer.c b/cgminer.c
index 3094c2a..60c4497 100644
--- a/cgminer.c
+++ b/cgminer.c
@@ -1504,7 +1504,7 @@ static void suffix_string(uint64_t val, char *buf, int sigdigits)
 
 	if (!sigdigits) {
 		if (decimal)
-			sprintf(buf, "%.1f%s", dval, suffix);
+			sprintf(buf, "%.3g%s", dval, suffix);
 		else
 			sprintf(buf, "%d%s", (unsigned int)dval, suffix);
 	} else {