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:
parent
210c5f64ab
commit
b00b374e64
1 changed files with 2 additions and 4 deletions
|
|
@ -2634,10 +2634,8 @@ def scourUnitlessLength(length, needsRendererWorkaround=False): # length is of
|
||||||
else:
|
else:
|
||||||
length = length.normalize()
|
length = length.normalize()
|
||||||
|
|
||||||
# gather the non-scientific notation version of the coordinate.
|
# Gather the non-scientific notation version of the coordinate.
|
||||||
# this may actually be in scientific notation if the value is
|
nonsci = '{0:f}'.format(length)
|
||||||
# sufficiently large or small, so this is a misnomer.
|
|
||||||
nonsci = six.text_type(length).lower().replace("e+", "e")
|
|
||||||
if not needsRendererWorkaround:
|
if not needsRendererWorkaround:
|
||||||
if len(nonsci) > 2 and nonsci[:2] == '0.':
|
if len(nonsci) > 2 and nonsci[:2] == '0.':
|
||||||
nonsci = nonsci[1:] # remove the 0, leave the dot
|
nonsci = nonsci[1:] # remove the 0, leave the dot
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue