From 3eb2d1338ff801bf307996926394e8d043ced98e Mon Sep 17 00:00:00 2001 From: Yaroslav Brustinov Date: Wed, 18 May 2016 19:12:14 +0300 Subject: tui fixes --- .../stl/trex_stl_lib/utils/text_opts.py | 17 +++++------------ 1 file changed, 5 insertions(+), 12 deletions(-) (limited to 'scripts/automation/trex_control_plane/stl/trex_stl_lib/utils/text_opts.py') diff --git a/scripts/automation/trex_control_plane/stl/trex_stl_lib/utils/text_opts.py b/scripts/automation/trex_control_plane/stl/trex_stl_lib/utils/text_opts.py index 72be7c29..7e0bf9e4 100644 --- a/scripts/automation/trex_control_plane/stl/trex_stl_lib/utils/text_opts.py +++ b/scripts/automation/trex_control_plane/stl/trex_stl_lib/utils/text_opts.py @@ -36,18 +36,11 @@ def format_num (size, suffix = "", compact = True, opts = ()): u = '' if compact: - if 0 < abs(size) < 1: - for unit in ['m','u','n','p']: - size *= 1000 - if abs(size) >= 1: - u = unit - break - else: - for unit in ['','K','M','G','T','P']: - if abs(size) < 1000.0: - u = unit - break - size /= 1000.0 + for unit in ['','K','M','G','T','P']: + if abs(size) < 1000.0: + u = unit + break + size /= 1000.0 if isinstance(size, float): txt = "%3.2f" % (size) -- cgit 1.2.3-korg