Skip to content

Commit b563ac0

Browse files
committed
Limit decimal places.
1 parent b9780ab commit b563ac0

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

  • CircuitPython_Templates/i2c_mcp9808

CircuitPython_Templates/i2c_mcp9808/code.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,5 +9,5 @@
99
while True:
1010
temperature_celsius = mcp9808.temperature
1111
temperature_fahrenheit = temperature_celsius * 9 / 5 + 32
12-
print("Temperature: {} C {} F ".format(temperature_celsius, temperature_fahrenheit))
12+
print("Temperature: {:.2f} C {:.2f} F ".format(temperature_celsius, temperature_fahrenheit))
1313
time.sleep(2)

0 commit comments

Comments
 (0)