mirror of
https://github.com/GOSTSec/sgminer
synced 2025-02-02 18:14:20 +00:00
Pad out the suffix string function with zeroes on the right.
This commit is contained in:
parent
99adf397bd
commit
54d2999d77
@ -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…
x
Reference in New Issue
Block a user