Skip to content

Commit a9ff0ff

Browse files
committed
simplified chained comparisons
1 parent c3535a2 commit a9ff0ff

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

adafruit_ht16k33/segments.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -243,15 +243,15 @@ def _number(self, number, decimal=0):
243243
else:
244244
places = len(stnum[:dot])
245245

246-
if places <= 0 and decimal > 0:
246+
if places <= 0 < decimal:
247247
self.fill(False)
248248
places = 4
249249

250250
if "." in stnum:
251251
places += 1
252252

253253
# Set decimal places, if number of decimal places is specified (decimal > 0)
254-
if places > 0 and decimal > 0 and dot > 0 and (len(stnum[places:]) > decimal):
254+
if places > 0 < decimal < len(stnum[places:]) and dot > 0:
255255
txt = stnum[: dot + decimal + 1]
256256
elif places > 0:
257257
txt = stnum[:places]

0 commit comments

Comments
 (0)