minor regex improvement
This commit is contained in:
parent
f1aab8b1e4
commit
02c162e303
1 changed files with 1 additions and 1 deletions
|
@ -139,7 +139,7 @@ class SVGImage:
|
|||
|
||||
def _trim_decimals(self, data):
|
||||
# remove trailing zeros from a decimal
|
||||
return re.sub(r'([0-9]+)\.0', r'\1', re.sub(r'([0-9]+\.[0-9])[0-9]+', r'\1', data))
|
||||
return re.sub(r'([0-9]+)((\.[1-9])[0-9]+|\.[0-9]+)?', r'\1\3', data)
|
||||
|
||||
def _create_geometry(self, geometry):
|
||||
# convert a shapely geometry into an svg xml element
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue