T
T
timur_gis2018-11-15 15:56:55
Python
timur_gis, 2018-11-15 15:56:55

How to implement rounding by squares in a string?

How to implement rounding by squares in a string with step (5) and remove unnecessary values?
Input:
Direction
N 10-44-2 W
N 78-32-27 W
N 40-12-5 E
S 58-50-10 E
N 88-32-50 E
End result:
Direction
N 10-45 W
N 78 -30 W
N 40-10 E
S 58-50 E
N 88-30 E

Answer the question

In order to leave comments, you need to log in

1 answer(s)
J
Juhani Lahtinen, 2018-11-15
@timur_gis

If it's really stupid

qwe = "N 10-44-2 W".split(" ")
qwe[0]+" "+qwe[1][0:5]+" "+qwe[2]

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question