From 0aba86ccb41f491dc9ea87c6642fe455ddf43612 Mon Sep 17 00:00:00 2001 From: mikeller Date: Sun, 3 Jun 2018 22:40:01 +1200 Subject: [PATCH] Converted it to fixed width. --- src/main/io/osd.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/main/io/osd.c b/src/main/io/osd.c index fb5c682d32..f4051ff1a9 100644 --- a/src/main/io/osd.c +++ b/src/main/io/osd.c @@ -273,7 +273,11 @@ static char osdGetTemperatureSymbolForSelectedUnit(void) static void osdFormatAltitudeString(char * buff, int altitude) { const int alt = osdGetMetersToSelectedUnit(altitude) / 10; - tfp_sprintf(buff, "%s%d.%01d%c", alt < 0 ? "-" : "", abs(alt / 10), abs(alt % 10), osdGetMetersToSelectedUnitSymbol()); + + tfp_sprintf(buff, "%5d", alt); + buff[5] = buff[4]; + buff[4] = '.'; + buff[6] = osdGetMetersToSelectedUnitSymbol(); } static void osdFormatPID(char * buff, const char * label, const pid8_t * pid)