From: Gerhard Sittig Date: Sun, 27 May 2018 07:41:19 +0000 (+0200) Subject: counter: explicit string formatting for annotation text X-Git-Url: https://sigrok.org/gitweb/?p=libsigrokdecode.git;a=commitdiff_plain;h=866a80dbed40dcd295efd4c7f28288b7835c973d counter: explicit string formatting for annotation text Replace str() conversion with explicit number text formatting, for improved awareness and easier future adjustment during maintenance. --- diff --git a/decoders/counter/pd.py b/decoders/counter/pd.py index 4b5085b..905de6e 100644 --- a/decoders/counter/pd.py +++ b/decoders/counter/pd.py @@ -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)])