mirror of
https://github.com/esphome/esphome.git
synced 2026-02-08 08:41:59 +00:00
fixes
This commit is contained in:
@@ -695,8 +695,11 @@ inline char *int8_to_str(char *buf, int8_t val) {
|
||||
if (v >= 100) {
|
||||
*buf++ = '1'; // int8 max is 128, so hundreds digit is always 1
|
||||
v -= 100;
|
||||
}
|
||||
if (v >= 10) {
|
||||
// Must write tens digit (even if 0) after hundreds
|
||||
int tens = v / 10;
|
||||
*buf++ = '0' + tens;
|
||||
v -= tens * 10;
|
||||
} else if (v >= 10) {
|
||||
int tens = v / 10;
|
||||
*buf++ = '0' + tens;
|
||||
v -= tens * 10;
|
||||
|
||||
Reference in New Issue
Block a user