summaryrefslogtreecommitdiff
path: root/gnuradio-runtime/python/gnuradio/eng_notation.py
diff options
context:
space:
mode:
Diffstat (limited to 'gnuradio-runtime/python/gnuradio/eng_notation.py')
-rw-r--r--gnuradio-runtime/python/gnuradio/eng_notation.py3
1 files changed, 2 insertions, 1 deletions
diff --git a/gnuradio-runtime/python/gnuradio/eng_notation.py b/gnuradio-runtime/python/gnuradio/eng_notation.py
index 12332aef7d..391dc5838f 100644
--- a/gnuradio-runtime/python/gnuradio/eng_notation.py
+++ b/gnuradio-runtime/python/gnuradio/eng_notation.py
@@ -21,6 +21,7 @@
"""
Display numbers as strings using engineering notation.
"""
+from __future__ import unicode_literals
scale_factor = {}
scale_factor['E'] = 1e18
@@ -67,7 +68,7 @@ def str_to_num (value):
try:
scale = 1.0
suffix = value[-1]
- if scale_factor.has_key (suffix):
+ if suffix in scale_factor:
return float (value[0:-1]) * scale_factor[suffix]
return float (value)
except: