mirror of
https://github.com/emsesp/EMS-ESP32.git
synced 2025-12-07 16:29:51 +03:00
handle negative short values
This commit is contained in:
@@ -55,6 +55,8 @@ char * _short_to_char(char * s, int16_t value, uint8_t decimals) {
|
|||||||
if (value < 0) {
|
if (value < 0) {
|
||||||
strlcpy(s, "-", 10);
|
strlcpy(s, "-", 10);
|
||||||
value *= -1; // convert to positive
|
value *= -1; // convert to positive
|
||||||
|
} else {
|
||||||
|
strlcpy(s, "", 10);
|
||||||
}
|
}
|
||||||
|
|
||||||
// do floating point
|
// do floating point
|
||||||
|
|||||||
Reference in New Issue
Block a user