diff --git a/ESP32-IDF_Temperture-Node-v2/main/mqttronix.c b/ESP32-IDF_Temperture-Node-v2/main/mqttronix.c index 9b9c6a299..47d1a79a1 100644 --- a/ESP32-IDF_Temperture-Node-v2/main/mqttronix.c +++ b/ESP32-IDF_Temperture-Node-v2/main/mqttronix.c @@ -82,4 +82,7 @@ void mqttronix_start(void) { esp_mqtt_client_start(client); } -void mqttronix_update_temp (float temp) { temp_value = temp; } \ No newline at end of file +void mqttronix_update_temp (float temp) { + temp_value = temp; + snprintf(temp_str, sizeof(temp_str), "%.02f", temp_value); +} \ No newline at end of file