aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorArun Isaac2023-10-07 20:45:08 +0100
committerArun Isaac2023-10-07 20:45:08 +0100
commit35e35f233b5dcf7669361df5ebb8e33f799ae52d (patch)
tree3abf0685a34c428888b5a37a062abcc459cddb4c
parentd97998201a16e1eda23f9f0654561e8a659a8f38 (diff)
downloadrent-in-london-35e35f233b5dcf7669361df5ebb8e33f799ae52d.tar.gz
rent-in-london-35e35f233b5dcf7669361df5ebb8e33f799ae52d.tar.lz
rent-in-london-35e35f233b5dcf7669361df5ebb8e33f799ae52d.zip
Never use exponential notation for latitudes and longitudes.
* rent.scm (cycling-distance): Use ~f instead of ~a while formatting latitudes and longitudes.
-rw-r--r--rent.scm6
1 files changed, 5 insertions, 1 deletions
diff --git a/rent.scm b/rent.scm
index 1effb3e..7ae101d 100644
--- a/rent.scm
+++ b/rent.scm
@@ -352,7 +352,11 @@ and not distance as the crow flies."
#(point-b-latitude point-b-longitude))
(call-with-port (open-bytevector-input-port
(http-get*
- (format #f "~a/table/v1/bike/~a,~a;~a,~a?annotations=distance&sources=0&destinations=1"
+ ;; We use ~f for latitude/longitude since ~a
+ ;; would use the exponential float notation for
+ ;; small numbers and the API does not like
+ ;; that.
+ (format #f "~a/table/v1/bike/~f,~f;~f,~f?annotations=distance&sources=0&destinations=1"
%osrm-base-url
point-a-longitude point-a-latitude
point-b-longitude point-b-latitude)))