Fix for displaying integer values in menu.

pull/9/head^2
Holger Wirtz 5 years ago
parent f34eccfc6f
commit 62d7e69f2b
  1. 10
      UI.hpp

@ -1779,6 +1779,14 @@ void lcd_display_int(int16_t var, uint8_t size, bool zeros, bool brackets, bool
lcd.print(F(" ")); lcd.print(F(" "));
} }
if (var == 0 && zeros == false)
{
for (int8_t i = size - 1 ; i > 0; i--)
lcd.print(F(" "));
lcd.print(F("0"));
}
else
{
for (int8_t i = size - 1 ; i >= 0; i--) for (int8_t i = size - 1 ; i >= 0; i--)
{ {
p = int(pow(10, i)); p = int(pow(10, i));
@ -1803,11 +1811,11 @@ void lcd_display_int(int16_t var, uint8_t size, bool zeros, bool brackets, bool
} }
var -= (tmp * p); var -= (tmp * p);
} }
}
if (brackets == true) if (brackets == true)
lcd.print(F("]")); lcd.print(F("]"));
} }
void lcd_display_float(float var, uint8_t size_number, uint8_t size_fraction, bool zeros, bool brackets, bool sign) void lcd_display_float(float var, uint8_t size_number, uint8_t size_fraction, bool zeros, bool brackets, bool sign)
{ {
float fraction; float fraction;

Loading…
Cancel
Save