We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 28b2d25 commit d22cc67Copy full SHA for d22cc67
adafruit_gps.py
@@ -85,9 +85,9 @@ def _parse_degrees(nmea_data):
85
# this into a float or separate parts to retain the precision
86
raw = nmea_data.split(".")
87
deg = int(raw[0]) // 100 * 1000000 # the ddd
88
- minutes = int(raw[0]) % 100 * 10000 # the mm.
89
- minutes += int(raw[1]) # the .mmmm
90
- minutes = int(minutes / 60 * 100)
+ minutes = int(raw[0]) % 100 # the mm.
+ minutes += int(f"{raw[1][:4]:0<4}") / 10000 # the .mmmm
+ minutes = int(minutes / 60 * 1000000)
91
return deg + minutes
92
93
0 commit comments