From 7f66cc5d184c8805d1f830a4b76fc2f6a27b29e8 Mon Sep 17 00:00:00 2001 From: Joe Muzina Date: Wed, 13 Apr 2022 15:27:54 -0400 Subject: [PATCH] rounding fix --- app.py | 2 +- static/activityFiltering.js | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/app.py b/app.py index 0355a58..b2aa749 100644 --- a/app.py +++ b/app.py @@ -256,7 +256,7 @@ def render_generatePage(): file.save(os.path.join(flaskApp.config['UPLOAD_FOLDER'], filename)) totalLength = request.form["selectedActivityLength"] - totalDistance = str(int(request.form["selectedActivityDistance"])) + totalDistance = request.form["selectedActivityDistance"] if session["networkName"] != "gpxFile": userCachedData[uniqueId]["visualizationResult"] = functions.getImageBase64String(generateVis.getVis(data=data, lineThickness=int(formArgs["pathThickness"]), gridOn=formArgs["displayGridLines"] == "on", backgroundColor=formArgs["backgroundColor"], backgroundImage = filename, backgroundBlur = formArgs["blurIntensity"], foregroundColor=formArgs["pathColor"], gridColor=formArgs["gridlineColor"], gridThickness=int(formArgs["gridThickness"]), infoText=formArgs["infoText"],silhouetteImage=formArgs["silhouetteImage"], duplicateActivities=formArgs["duplicateActivities"], textBackgroundFade=formArgs["textBackgroundFade"], totalTime=functions.getTimeStr(totalLength), totalDistance=str(totalDistance) + " mi.")) diff --git a/static/activityFiltering.js b/static/activityFiltering.js index 7ca10fe..035c86c 100644 --- a/static/activityFiltering.js +++ b/static/activityFiltering.js @@ -142,8 +142,8 @@ function searchActivities(activities) { const selectedDistanceElement = document.getElementById("selectedActivityDistance"); selectedLengthElement["value"] = selectedActivitiesLength; selectedLengthElement.setAttribute("value", selectedActivitiesLength); - selectedDistanceElement["value"] = selectedActivitiesDistance; - selectedDistanceElement.setAttribute("value", selectedActivitiesDistance); + selectedDistanceElement["value"] = Math.round(selectedActivitiesDistance); + selectedDistanceElement.setAttribute("value", Math.round(selectedActivitiesDistance)); } // Element IDs of parameter input elements that should cause a live update of