Browse Source

Pad out the suffix string function with zeroes on the right.

nfactor-troky
Con Kolivas 12 years ago
parent
commit
54d2999d77
  1. 9
      cgminer.c

9
cgminer.c

@ -1501,8 +1501,13 @@ static void suffix_string(uint64_t val, char *buf, int sigdigits)
if (!sigdigits) if (!sigdigits)
sprintf(buf, "%d%s", (unsigned int)dval, suffix); sprintf(buf, "%d%s", (unsigned int)dval, suffix);
else else {
sprintf(buf, "%-*.*g%s", sigdigits + 1, sigdigits, dval, suffix); /* Always show sigdigits + 1, padded on right with zeroes
* followed by suffix */
int ndigits = (sigdigits - 1 - floor(log10 (dval)));
sprintf(buf, "%*.*f%s", sigdigits + 1, ndigits, dval, suffix);
}
} }
static void get_statline(char *buf, struct cgpu_info *cgpu) static void get_statline(char *buf, struct cgpu_info *cgpu)

Loading…
Cancel
Save