mirror of
https://github.com/emsesp/EMS-ESP32.git
synced 2026-01-28 09:39:11 +03:00
@@ -297,7 +297,7 @@ char * Helpers::render_value(char * result, const int32_t value, const int8_t fo
|
||||
} else if (format > 0) {
|
||||
strlcat(result, itoa(new_value / format, s, 10), sizeof(s));
|
||||
strlcat(result, ".", sizeof(s));
|
||||
strlcat(result, itoa((new_value % format + format / 2) * 10 / format, s, 10), sizeof(s));
|
||||
strlcat(result, itoa(((new_value % format) * 10 + format / 2) / format, s, 10), sizeof(s));
|
||||
} else {
|
||||
strlcat(result, itoa(new_value * format * -1, s, 10), sizeof(s));
|
||||
}
|
||||
@@ -337,9 +337,9 @@ char * Helpers::render_value(char * result, const uint32_t value, const int8_t f
|
||||
if (!hasValue(value)) {
|
||||
return nullptr;
|
||||
}
|
||||
result[0] = '\0';
|
||||
int32_t new_value = fahrenheit ? format ? value * 1.8 + 32 * format * (fahrenheit - 1) : value * 1.8 + 32 * (fahrenheit - 1) : value;
|
||||
char s[10] = {0};
|
||||
result[0] = '\0';
|
||||
uint32_t new_value = fahrenheit ? format ? value * 1.8 + 32 * format * (fahrenheit - 1) : value * 1.8 + 32 * (fahrenheit - 1) : value;
|
||||
char s[10] = {0};
|
||||
|
||||
#ifndef EMSESP_STANDALONE
|
||||
if (!format) {
|
||||
@@ -347,7 +347,7 @@ char * Helpers::render_value(char * result, const uint32_t value, const int8_t f
|
||||
} else if (format > 0) {
|
||||
strlcpy(result, ltoa(new_value / format, s, 10), sizeof(s));
|
||||
strlcat(result, ".", sizeof(s));
|
||||
strlcat(result, itoa((new_value % format + format / 2) * 10 / format, s, 10), sizeof(s));
|
||||
strlcat(result, itoa(((new_value % format) * 10 + format / 2) / format, s, 10), sizeof(s));
|
||||
} else {
|
||||
strlcpy(result, ltoa(new_value * format * -1, s, 10), sizeof(s));
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user