From 0959439e39cb5a89f9a76454c0ce2b470e230bae Mon Sep 17 00:00:00 2001 From: Anton Khorev Date: Fri, 11 Apr 2025 15:19:06 +0300 Subject: [PATCH] Remove unnecessary string conversions in distance formatting --- app/assets/javascripts/index/directions-route-output.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/app/assets/javascripts/index/directions-route-output.js b/app/assets/javascripts/index/directions-route-output.js index cf00c90dc..16668cd27 100644 --- a/app/assets/javascripts/index/directions-route-output.js +++ b/app/assets/javascripts/index/directions-route-output.js @@ -33,13 +33,13 @@ OSM.DirectionsRouteOutput = function (map) { if (m < 5) { return ""; } else if (m < 200) { - return OSM.i18n.t("m", { scope, distance: String(Math.round(m / 10) * 10) }); + return OSM.i18n.t("m", { scope, distance: Math.round(m / 10) * 10 }); } else if (m < 1500) { - return OSM.i18n.t("m", { scope, distance: String(Math.round(m / 100) * 100) }); + return OSM.i18n.t("m", { scope, distance: Math.round(m / 100) * 100 }); } else if (m < 5000) { - return OSM.i18n.t("km", { scope, distance: String(Math.round(m / 100) / 10) }); + return OSM.i18n.t("km", { scope, distance: Math.round(m / 100) / 10 }); } else { - return OSM.i18n.t("km", { scope, distance: String(Math.round(m / 1000)) }); + return OSM.i18n.t("km", { scope, distance: Math.round(m / 1000) }); } } -- 2.39.5