counter: explicit string formatting for annotation text
authorGerhard Sittig <gerhard.sittig@gmx.net>
Sun, 27 May 2018 07:41:19 +0000 (09:41 +0200)
committerUwe Hermann <uwe@hermann-uwe.de>
Tue, 29 May 2018 21:57:48 +0000 (23:57 +0200)
Replace str() conversion with explicit number text formatting, for
improved awareness and easier future adjustment during maintenance.

decoders/counter/pd.py

index 4b5085bf772bd666a9859e7488f499faaf86ccf4..905de6e0514aa9c0a61c0628f9414a579e9410ec 100644 (file)
@@ -98,8 +98,8 @@ class Decoder(srd.Decoder):
                 continue
 
             edge_count += 1
-            self.putc(ROW_EDGE, [str(edge_count)])
+            self.putc(ROW_EDGE, ["{:d}".format(edge_count)])
 
             if divider and (edge_count % divider) == 0:
                 word_count += 1
-                self.putc(ROW_WORD, [str(word_count)])
+                self.putc(ROW_WORD, ["{:d}".format(word_count)])