mirror of
https://github.com/emsesp/EMS-ESP32.git
synced 2025-12-06 15:59:52 +03:00
Merge branch 'dev' of https://github.com/emsesp/EMS-ESP32 into dev2
This commit is contained in:
@@ -277,7 +277,7 @@ char * Helpers::render_value(char * result, const double value, const int8_t for
|
|||||||
// format: 0=no division, other divide by the value given and render with a decimal point
|
// format: 0=no division, other divide by the value given and render with a decimal point
|
||||||
char * Helpers::render_value(char * result, const int32_t value, const int8_t format, const uint8_t fahrenheit) {
|
char * Helpers::render_value(char * result, const int32_t value, const int8_t format, const uint8_t fahrenheit) {
|
||||||
int32_t new_value = fahrenheit ? format ? value * 1.8 + 32 * format * (fahrenheit - 1) : value * 1.8 + 32 * (fahrenheit - 1) : value;
|
int32_t new_value = fahrenheit ? format ? value * 1.8 + 32 * format * (fahrenheit - 1) : value * 1.8 + 32 * (fahrenheit - 1) : value;
|
||||||
char s[10] = {0};
|
char s[13] = {0};
|
||||||
// just print it if no conversion required (format = 0)
|
// just print it if no conversion required (format = 0)
|
||||||
if (!format) {
|
if (!format) {
|
||||||
strlcpy(result, itoa(new_value, s, 10), sizeof(s)); // format is 0
|
strlcpy(result, itoa(new_value, s, 10), sizeof(s)); // format is 0
|
||||||
|
|||||||
Reference in New Issue
Block a user