From 7c8640dd65b386f82ca820f738afc67831477edf Mon Sep 17 00:00:00 2001 From: Tuomas Suutari Date: Thu, 12 Dec 2019 09:21:57 +0200 Subject: [PATCH] models/parking_check: Fix a bug in _format_coordinates The latitude and longitude should be absolute values, since the sign is told via E/W or N/S letters in the suffix. --- parkings/models/parking_check.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/parkings/models/parking_check.py b/parkings/models/parking_check.py index e930d251..c3f9068e 100644 --- a/parkings/models/parking_check.py +++ b/parkings/models/parking_check.py @@ -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)