[ADD] formatting lcd text

This commit is contained in:
Sem van der Hoeven
2021-04-06 13:39:54 +02:00
parent 3f7c1f9ee3
commit b7c1a25671
14 changed files with 2126 additions and 1703 deletions

View File

@@ -130,3 +130,11 @@ void lcd_write_int(int number)
snprintf(str, length + 1, "%d", number);
lcd_write_string(str);
}
void lcd_write_double(char prefix[], double number, char suffix[])
{
int length = snprintf(NULL, 0, "%s: %.3f %s", prefix, number, suffix);
char str[length + 1];
snprintf(str, length + 1, "%s: %.3f %s", prefix, number, suffix);
lcd_write_string(str);
}