Set only 3 decimal digits when displaying best share diff

This commit is contained in:
BitMaker 2023-08-07 22:51:05 +02:00
parent 989d33efbe
commit 3bbeb227a6

View File

@ -408,6 +408,7 @@ void suffix_string(double val, char *buf, size_t bufsiz, int sigdigits)
const double exa = 1000000000000000000; const double exa = 1000000000000000000;
// minimum diff value to display // minimum diff value to display
const double min_diff = 0.001; const double min_diff = 0.001;
const byte maxNdigits = 2;
char suffix[2] = ""; char suffix[2] = "";
bool decimal = true; bool decimal = true;
double dval; double dval;
@ -443,7 +444,7 @@ void suffix_string(double val, char *buf, size_t bufsiz, int sigdigits)
if (!sigdigits) { if (!sigdigits) {
if (decimal) if (decimal)
snprintf(buf, bufsiz, "%.3g%s", dval, suffix); snprintf(buf, bufsiz, "%.3f%s", dval, suffix);
else else
snprintf(buf, bufsiz, "%d%s", (unsigned int)dval, suffix); snprintf(buf, bufsiz, "%d%s", (unsigned int)dval, suffix);
} else { } else {