Don't show a leading zero for one-digit numbers
This commit is contained in:
parent
6b0d42a35f
commit
04d45ec03e
@ -28,7 +28,11 @@ public:
|
|||||||
void set(uint8_t number) {
|
void set(uint8_t number) {
|
||||||
uint8_t num = constrain(number, 0, 99);
|
uint8_t num = constrain(number, 0, 99);
|
||||||
this->number[0] = pgm_read_byte_near(DECODER + num % 10);
|
this->number[0] = pgm_read_byte_near(DECODER + num % 10);
|
||||||
this->number[1] = 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() {
|
void setOff() {
|
||||||
|
Loading…
Reference in New Issue
Block a user