From a7a5c583d295c70f63898a005bd00b7d84412478 Mon Sep 17 00:00:00 2001 From: Trygve Laugstøl Date: Fri, 22 Sep 2017 15:33:34 +0200 Subject: o Fixing parsing of '0.1' values too. --- src/ee/formatting/__init__.py | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) (limited to 'src/ee/formatting') diff --git a/src/ee/formatting/__init__.py b/src/ee/formatting/__init__.py index 4527a96..3fa82d2 100644 --- a/src/ee/formatting/__init__.py +++ b/src/ee/formatting/__init__.py @@ -95,10 +95,6 @@ def eng_str(value, unit=None): scale = 10 ** (div3 * 3) scaled = value / scale - if (scaled - math.floor(scaled)) < 0.0001: - # if scaled == math.floor(scaled): - s = "{:1.0f}{}".format(scaled, suffix) - else: - s = "{:1.1f}{}".format(scaled, suffix) + s = "{:1.3g}{}".format(scaled, suffix) return s -- cgit v1.2.3