Skip to content

Commit

Permalink
models/parking_check: Fix a bug in _format_coordinates
Browse files Browse the repository at this point in the history
The latitude and longitude should be absolute values, since the sign is
told via E/W or N/S letters in the suffix.
  • Loading branch information
suutari-ai committed Jan 10, 2020
1 parent e48f687 commit 7c8640d
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion parkings/models/parking_check.py
Original file line number Diff line number Diff line change
Expand Up @@ -68,5 +68,5 @@ def _format_coordinates(location, prec=5):
e_or_w = "E" if longitude >= 0.0 else "W"
n_or_s = "N" if latitude >= 0.0 else "S"
return "{latitude:.{prec}f}{n_or_s} {longitude:.{prec}f}{e_or_w}".format(
latitude=latitude, longitude=longitude,
latitude=abs(latitude), longitude=abs(longitude),
prec=prec, n_or_s=n_or_s, e_or_w=e_or_w)

0 comments on commit 7c8640d

Please sign in to comment.