From 60b375135fa863d00c8cb33fc8ef94f7a97b97f8 Mon Sep 17 00:00:00 2001 From: Werner Almesberger Date: Fri, 1 Feb 2013 00:42:29 -0300 Subject: [PATCH] ubb-la/gui.c (si_text): used fixed %7.3f format if we have 7 characters The variable number of digits was more confusing than useful. A drawback is we may no longer see single-sample time changes when near the end of the buffer. --- ubb-la/gui.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/ubb-la/gui.c b/ubb-la/gui.c index bb45ad8..4945a00 100644 --- a/ubb-la/gui.c +++ b/ubb-la/gui.c @@ -397,6 +397,8 @@ static void si_text(int x, int y, double v, const char *unit, int digits) textf(x, y, TEXT_RGBA, "%3d", (int) (v+0.5)); else if (v >= 100 && digits == 4) textf(x, y, TEXT_RGBA, "%4d", (int) (v+0.5)); + else if (digits == 7) + textf(x, y, TEXT_RGBA, "%*.*f", digits, 3, v); else if (v >= 100) textf(x, y, TEXT_RGBA, "%*.*f", digits, digits-4, v); else if (v >= 10)