Skip to content

Commit 80ecec9

Browse files
authored
No rounding of the variable...
Rounding at display time to preserve precision.
1 parent 8d75f10 commit 80ecec9

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

PyPortal_User_Interface/code.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -342,8 +342,8 @@ def switch_view(what_view):
342342
else: # No temperature sensor
343343
tempC = microcontroller.cpu.temperature
344344

345-
tempF = round(tempC * 1.8 + 32)
346-
sensor_data.text = 'Touch: {}\nLight: {}\n Temp: {}°F'.format(touch, light, tempF)
345+
tempF = tempC * 1.8 + 32
346+
sensor_data.text = 'Touch: {}\nLight: {}\n Temp: {:.0f}°F'.format(touch, light, tempF)
347347

348348
# ------------- Handle Button Press Detection ------------- #
349349
if touch: # Only do this if the screen is touched

0 commit comments

Comments
 (0)