I have this in my SVG file:
d="
m49.84965,40.23129
l99.5682,19.94812
l0.2192,100.11412
l-100.78656,-19.99842
z"
I want to have rounded coordinates:
d="
m50,40
l100,20
l0,100
l-100,-20
z"/>
The entire document is much larger. I used regex to erase the decimals, which are lower then 5:
\.[01234]\d*
But with rounding higher decimals I had much more work:
0\.[56789]\d* ;replace with: 1
1\.[56789]\d* ;replace with: 2
2\. ...
It began to be complicated, when I had to deal with numbers like this one: -19.99842
How do I handle this?