Converted it to fixed width.

This commit is contained in:
mikeller 2018-06-03 22:40:01 +12:00
parent e30f1fadd9
commit 0aba86ccb4
1 changed files with 5 additions and 1 deletions

View File

@ -273,7 +273,11 @@ static char osdGetTemperatureSymbolForSelectedUnit(void)
static void osdFormatAltitudeString(char * buff, int altitude) static void osdFormatAltitudeString(char * buff, int altitude)
{ {
const int alt = osdGetMetersToSelectedUnit(altitude) / 10; 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) static void osdFormatPID(char * buff, const char * label, const pid8_t * pid)