Rounding and extra market digit

tinySA-v0.2
erikkaashoek 6 years ago
parent dbb685f794
commit 7a616786ca

@ -849,7 +849,7 @@ static void trace_get_value_string(
(void) point_count;
float v;
char buf2[11];
char buf3[6];
char buf3[8];
buf2[0]=' ';
uint32_t dfreq = 0;
float rlevel = 0;
@ -905,14 +905,15 @@ static void trace_get_value_string(
else {
v = v - rlevel;
if (UNIT_IS_LINEAR(setting.unit)) {
if (v < 100000)
plot_printf(buf3, sizeof(buf3), "%5f", v);
if (v < 1000000)
plot_printf(buf3, sizeof(buf3), "%6f", v);
else
strcpy(buf3,"*****");
}
else
strcpy(buf3,"******");
buf3[6] = 0;
} else {
plot_printf(buf3, sizeof(buf3), "%5.1f", v);
buf3[5] = 0;
buf3[5] = 0;
}
plot_printf(buf, len, "%s %s%s%s", buf2, buf3,unit_string[setting.unit],(mtype & M_NOISE?"/Hz":""));
}
}

@ -1816,7 +1816,7 @@ void draw_cal_status(void)
if (rounding)
plot_printf(buf, BLEN, "%6d", (int)yMax);
else
plot_printf(buf, BLEN, "%6f", yMax);
plot_printf(buf, BLEN, "%6f", yMax+0.00005);
buf[6]=0;
if (level_is_calibrated()) {
if (setting.auto_reflevel)
@ -2054,7 +2054,7 @@ void draw_cal_status(void)
if (rounding)
plot_printf(buf, BLEN, "%6d", (int)(yMax - setting.scale * NGRIDY));
else
plot_printf(buf, BLEN, "%6f", (yMax - setting.scale * NGRIDY));
plot_printf(buf, BLEN, "%6f", (yMax - setting.scale * NGRIDY)+0.00005);
buf[6]=0;
if (level_is_calibrated())
if (setting.auto_reflevel)

Loading…
Cancel
Save

Powered by TurnKey Linux.