From 76a55726e85327ff1948ad24f07b72fd21df02c5 Mon Sep 17 00:00:00 2001 From: Tobias Schramm Date: Tue, 9 Feb 2021 13:59:17 +0100 Subject: [PATCH] Print SOC with constant length --- src/main.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main.c b/src/main.c index 3ae76f9..81f7a28 100644 --- a/src/main.c +++ b/src/main.c @@ -98,7 +98,7 @@ void main(void) snprintf(tmpstr, sizeof(tmpstr), "%04u mV", battery_get_voltage_mv()); platform_display_draw_string(0, DISPLAY_LINE_BATTERY_VOLTAGE + 1, tmpstr); - snprintf(tmpstr, sizeof(tmpstr), "%u%%", battery_voltage_mv_to_soc(battery_get_voltage_mv())); + snprintf(tmpstr, sizeof(tmpstr), "% 3u%%", battery_voltage_mv_to_soc(battery_get_voltage_mv())); platform_display_draw_string(0, DISPLAY_LINE_BATTERY_VOLTAGE + 3, tmpstr); } do_covid();