From 45849c0f604116917e5813184ff58358d58a4725 Mon Sep 17 00:00:00 2001 From: Federico Amedeo Izzo Date: Sun, 1 Nov 2020 19:55:49 +0100 Subject: [PATCH] UI: Fix missing zeroes from clock and VBat --- openrtx/src/ui.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/openrtx/src/ui.c b/openrtx/src/ui.c index d0166b85..a593623e 100644 --- a/openrtx/src/ui.c +++ b/openrtx/src/ui.c @@ -197,14 +197,14 @@ void ui_drawTopBar() // Print clock on top bar char clock_buf[6] = ""; curTime_t time = rtc_getTime(); - snprintf(clock_buf, sizeof(clock_buf), "%2d:%2d", time.hour, time.minute); + snprintf(clock_buf, sizeof(clock_buf), "%02d:%02d", time.hour, time.minute); gfx_print(layout.top_pos, clock_buf, layout.top_font, TEXT_ALIGN_CENTER, color_white); // Print battery voltage on top bar, use 4 px padding // TODO: Replace with battery icon char bat_buf[6] = ""; float v_bat = platform_getVbat(); - snprintf(bat_buf, sizeof(bat_buf), "%.1fV ", v_bat); + snprintf(bat_buf, sizeof(bat_buf), "%02.1fV ", v_bat); gfx_print(layout.top_pos, bat_buf, layout.top_font, TEXT_ALIGN_RIGHT, color_white); }