Skip to content

Commit ae0019d

Browse files
tekktrikjkittner
authored andcommitted
Fix format specifier
1 parent 84a835f commit ae0019d

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

examples/gps_simpletest.py

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
import time
88
import board
99
import busio
10+
import math
1011

1112
import adafruit_gps
1213

@@ -84,13 +85,13 @@
8485
print("Latitude: {0:.6f} degrees".format(gps.latitude))
8586
print("Longitude: {0:.6f} degrees".format(gps.longitude))
8687
print(
87-
"Precise Latitude: {:2.}{:2.4f} degrees".format(
88-
gps.latitude_degrees, gps.latitude_minutes
88+
"Precise Latitude: {:3.0f} degs, {:2.4f} mins".format(
89+
math.floor(gps.latitude_degrees), gps.latitude_minutes
8990
)
9091
)
9192
print(
92-
"Precise Longitude: {:2.}{:2.4f} degrees".format(
93-
gps.longitude_degrees, gps.longitude_minutes
93+
"Precise Longitude: {:3.0f} degs, {:2.4f} mins".format(
94+
math.floor(gps.longitude_degrees), gps.longitude_minutes
9495
)
9596
)
9697
print("Fix quality: {}".format(gps.fix_quality))

0 commit comments

Comments
 (0)