diff options
author | Trygve Laugstøl <trygvis@inamo.no> | 2017-09-22 15:33:34 +0200 |
---|---|---|
committer | Trygve Laugstøl <trygvis@inamo.no> | 2017-09-22 16:37:16 +0200 |
commit | a7a5c583d295c70f63898a005bd00b7d84412478 (patch) | |
tree | 640822746e44ff90e895c052c4df2a6dfc44608c /src/ee/formatting | |
parent | 5c0c106c9fbdc9e5e189c8ba6903bbf70d803aba (diff) | |
download | ee-python-a7a5c583d295c70f63898a005bd00b7d84412478.tar.gz ee-python-a7a5c583d295c70f63898a005bd00b7d84412478.tar.bz2 ee-python-a7a5c583d295c70f63898a005bd00b7d84412478.tar.xz ee-python-a7a5c583d295c70f63898a005bd00b7d84412478.zip |
o Fixing parsing of '0.1' values too.
Diffstat (limited to 'src/ee/formatting')
-rw-r--r-- | src/ee/formatting/__init__.py | 6 |
1 files changed, 1 insertions, 5 deletions
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 |