Don't show a leading zero for one-digit numbers

This commit is contained in:
Klemens Schölhorn 2017-11-17 17:49:13 +01:00
parent 6b0d42a35f
commit 04d45ec03e

View File

@ -28,7 +28,11 @@ public:
void set(uint8_t number) {
uint8_t num = constrain(number, 0, 99);
this->number[0] = pgm_read_byte_near(DECODER + num % 10);
if(num / 10 >= 1) {
this->number[1] = pgm_read_byte_near(DECODER + num / 10);
} else {
this->number[1] = pgm_read_byte_near(DECODER + 10);
}
}
void setOff() {