diff --git a/firmware/src/main.c b/firmware/src/main.c index 9107b99..aa29b49 100644 --- a/firmware/src/main.c +++ b/firmware/src/main.c @@ -370,15 +370,18 @@ static void lcd_write_integer_page(const uint32_t integer, const bool invert) { if (digits != 0 || integer != 0) { uint8_t input_digits = 0; - uint16_t comperator = 1; + uint32_t comperator = 1; + // Get digits for (; comperator <= integer; comperator *= 10, input_digits++); + // Print leading zeroes for (int8_t i = digits - input_digits; i > 0; i--) { lcd_write_kerning(2, invert); lcd_write_digit_page(0, page, invert); } + // Print number itself for (; comperator >= 10; comperator /= 10) { lcd_write_kerning(2, invert); lcd_write_digit_page((integer % comperator) / (comperator / 10),