From c914e18fc1c66b6de1afdba51f28dbc71bee781d Mon Sep 17 00:00:00 2001 From: Victor Shcherb Date: Thu, 10 Sep 2020 11:37:36 +0200 Subject: [PATCH] Fix float format --- .../src/net/osmand/plus/server/OsmAndHttpServer.java | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/OsmAnd/src/net/osmand/plus/server/OsmAndHttpServer.java b/OsmAnd/src/net/osmand/plus/server/OsmAndHttpServer.java index adbda78898..f651c02a95 100644 --- a/OsmAnd/src/net/osmand/plus/server/OsmAndHttpServer.java +++ b/OsmAnd/src/net/osmand/plus/server/OsmAndHttpServer.java @@ -51,11 +51,11 @@ public class OsmAndHttpServer extends NanoHTTPD { public String getUrl() { RotatedTileBox rtb = mapActivity.getMapView().getCurrentRotatedTileBox(); - double lat = rtb.getLatitude(); - double lon = rtb.getLongitude(); - double z = rtb.getZoom(); - return "http://" + getHostname() + ":" + getListeningPort() - + "/?lat=" + lat + "&lon=" + lon + "&zoom=" + z; + float lat = (float) rtb.getLatitude(); + float lon = (float) rtb.getLongitude(); + int z = rtb.getZoom(); + return String.format("http://%s:%d/?lat=%.4f&lon%.4f&zoom=%d", getHostname(), getListeningPort(), + lat, lon, z); } private NanoHTTPD.Response routeApi(NanoHTTPD.IHTTPSession session) {