diff --git a/src/storage.cpp b/src/storage.cpp index 537c42d..43dccc7 100644 --- a/src/storage.cpp +++ b/src/storage.cpp @@ -52,7 +52,8 @@ uint8_t byteForAbsoluteTemperature(Temperature* temp) { if (temp->value < -39000) { return temperatureMinimumValue; } - long converted = (temp->value - (temperatureShiftForStorage)) / 500; + // Add 250 to improve rounding + long converted = (temp->value - (temperatureShiftForStorage) + 250) / 500; if (converted < temperatureMinimumValue) { return temperatureMinimumValue; }