summaryrefslogtreecommitdiff
path: root/decoders
diff options
context:
space:
mode:
Diffstat (limited to 'decoders')
-rw-r--r--decoders/jitter/pd.py12
-rw-r--r--decoders/pwm/pd.py12
2 files changed, 12 insertions, 12 deletions
diff --git a/decoders/jitter/pd.py b/decoders/jitter/pd.py
index d6db8e5..d572c36 100644
--- a/decoders/jitter/pd.py
+++ b/decoders/jitter/pd.py
@@ -91,17 +91,17 @@ class Decoder(srd.Decoder):
def putx(self, delta):
# Adjust granularity.
if delta == 0 or delta >= 1:
- delta_s = u"%us" % (delta)
+ delta_s = "%.1fs" % (delta)
elif delta <= 1e-12:
- delta_s = u"%.1ffs" % (delta * 1e15)
+ delta_s = "%.1ffs" % (delta * 1e15)
elif delta <= 1e-9:
- delta_s = u"%.1fps" % (delta * 1e12)
+ delta_s = "%.1fps" % (delta * 1e12)
elif delta <= 1e-6:
- delta_s = u"%.1fns" % (delta * 1e9)
+ delta_s = "%.1fns" % (delta * 1e9)
elif delta <= 1e-3:
- delta_s = u"%.1fμs" % (delta * 1e6)
+ delta_s = "%.1fμs" % (delta * 1e6)
else:
- delta_s = u"%.1fms" % (delta * 1e3)
+ delta_s = "%.1fms" % (delta * 1e3)
self.put(self.clk_start, self.sig_start, self.out_ann, [0, [delta_s]])
diff --git a/decoders/pwm/pd.py b/decoders/pwm/pd.py
index 45e96e2..e0203a3 100644
--- a/decoders/pwm/pd.py
+++ b/decoders/pwm/pd.py
@@ -77,17 +77,17 @@ class Decoder(srd.Decoder):
def putp(self, period_t):
# Adjust granularity.
if period_t == 0 or period_t >= 1:
- period_s = u'%u s' % (period_t)
+ period_s = '%.1f s' % (period_t)
elif period_t <= 1e-12:
- period_s = u'%.1f fs' % (period_t * 1e15)
+ period_s = '%.1f fs' % (period_t * 1e15)
elif period_t <= 1e-9:
- period_s = u'%.1f ps' % (period_t * 1e12)
+ period_s = '%.1f ps' % (period_t * 1e12)
elif period_t <= 1e-6:
- period_s = u'%.1f ns' % (period_t * 1e9)
+ period_s = '%.1f ns' % (period_t * 1e9)
elif period_t <= 1e-3:
- period_s = u'%.1f μs' % (period_t * 1e6)
+ period_s = '%.1f μs' % (period_t * 1e6)
else:
- period_s = u'%.1f ms' % (period_t * 1e3)
+ period_s = '%.1f ms' % (period_t * 1e3)
self.put(self.ss, self.es, self.out_ann, [1, [period_s]])