From b00b374e648cb95a4fb0abd8f593499907444598 Mon Sep 17 00:00:00 2001 From: Eduard Braun Date: Sat, 18 Feb 2017 18:06:09 +0100 Subject: [PATCH] Fix generation of non-scientific number representation. Before numbers often were already in scientific notation due to the str() implementation of Decimal leading to strange optimization results. --- scour/scour.py | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/scour/scour.py b/scour/scour.py index a6dede0..24bfaa6 100644 --- a/scour/scour.py +++ b/scour/scour.py @@ -2634,10 +2634,8 @@ def scourUnitlessLength(length, needsRendererWorkaround=False): # length is of else: length = length.normalize() - # gather the non-scientific notation version of the coordinate. - # this may actually be in scientific notation if the value is - # sufficiently large or small, so this is a misnomer. - nonsci = six.text_type(length).lower().replace("e+", "e") + # Gather the non-scientific notation version of the coordinate. + nonsci = '{0:f}'.format(length) if not needsRendererWorkaround: if len(nonsci) > 2 and nonsci[:2] == '0.': nonsci = nonsci[1:] # remove the 0, leave the dot