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.
This commit is contained in:
Eduard Braun 2017-02-18 18:06:09 +01:00
parent 210c5f64ab
commit b00b374e64

View file

@ -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