Skip to content

Commit 3037ab0

Browse files
committed
Remove decimal for non-metric temps
1 parent b3207c7 commit 3037ab0

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

examples/WeatherStationDemo/WeatherStationDemo.ino

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -283,7 +283,7 @@ void drawCurrentWeather(OLEDDisplay *display, OLEDDisplayUiState* state, int16_t
283283

284284
display->setFont(ArialMT_Plain_24);
285285
display->setTextAlignment(TEXT_ALIGN_LEFT);
286-
String temp = String(currentWeather.temp, 1) + (IS_METRIC ? "°C" : "°F");
286+
String temp = String(currentWeather.temp, (IS_METRIC ? 1 : 0)) + (IS_METRIC ? "°C" : "°F");
287287
display->drawString(60 + x, 5 + y, temp);
288288

289289
display->setFont(Meteocons_Plain_36);
@@ -325,7 +325,7 @@ void drawHeaderOverlay(OLEDDisplay *display, OLEDDisplayUiState* state) {
325325
display->setTextAlignment(TEXT_ALIGN_LEFT);
326326
display->drawString(0, 54, String(buff));
327327
display->setTextAlignment(TEXT_ALIGN_RIGHT);
328-
String temp = String(currentWeather.temp, 1) + (IS_METRIC ? "°C" : "°F");
328+
String temp = String(currentWeather.temp, (IS_METRIC ? 1 : 0)) + (IS_METRIC ? "°C" : "°F");
329329
display->drawString(128, 54, temp);
330330
display->drawHorizontalLine(0, 52, 128);
331331
}

0 commit comments

Comments
 (0)