diff --git a/index.html b/index.html index b077b09..68644c9 100644 --- a/index.html +++ b/index.html @@ -945,9 +945,9 @@

- minh

diff --git a/js/control/TrackStats.js b/js/control/TrackStats.js index 74e9d1f..f2fdd2a 100644 --- a/js/control/TrackStats.js +++ b/js/control/TrackStats.js @@ -14,26 +14,44 @@ BR.TrackStats = L.Class.extend({ } var stats = this.calcStats(polyline, segments), - length1 = L.Util.formatNum(stats.trackLength / 1000, 1), - length3 = L.Util.formatNum(stats.trackLength / 1000, 3), + length1 = L.Util.formatNum( + stats.trackLength / 1000, + 1 + ).toLocaleString(), + length3 = L.Util.formatNum( + stats.trackLength / 1000, + 3 + ).toLocaleString(), + formattedAscend = stats.filteredAscend.toLocaleString(), + formattedPlainAscend = stats.plainAscend.toLocaleString(), + formattedCost = stats.cost.toLocaleString(), meanCostFactor = stats.trackLength - ? L.Util.formatNum(stats.cost / stats.trackLength, 2) + ? L.Util.formatNum( + stats.cost / stats.trackLength, + 2 + ).toLocaleString() : '0', - formattedTime = L.Util.formatNum(stats.totalTime / 60, 1), - formattedEnergy = L.Util.formatNum(stats.totalEnergy / 3600000, 2), + formattedTime = + Math.trunc(stats.totalTime / 3600) + + ':' + + ('0' + Math.trunc((stats.totalTime % 3600) / 60)).slice(-2), + formattedEnergy = L.Util.formatNum( + stats.totalEnergy / 3600000, + 2 + ).toLocaleString(), meanEnergy = stats.trackLength ? L.Util.formatNum( stats.totalEnergy / 36 / stats.trackLength, 2 - ) + ).toLocaleString() : '0'; $('#distance').html(length1); // alternative 3-digit format down to meters as tooltip $('#distance').attr('title', length3 + ' km'); - $('#ascend').html(stats.filteredAscend); - $('#plainascend').html(stats.plainAscend); - $('#cost').html(stats.cost); + $('#ascend').html(formattedAscend); + $('#plainascend').html(formattedPlainAscend); + $('#cost').html(formattedCost); $('#meancostfactor').html(meanCostFactor); $('#totaltime').html(formattedTime); $('#totalenergy').html(formattedEnergy); diff --git a/locales/en.json b/locales/en.json index 81c2677..9f629a0 100644 --- a/locales/en.json +++ b/locales/en.json @@ -44,8 +44,8 @@ "kilowatthour-abbrev": "kWh", "meter": "meters", "meter-abbrev": "m", - "minutes": "minutes", - "minutes-abbrev": "min", + "hours": "hours", + "hours-abbrev": "h", "total-energy": "Total Energy", "energy-per-100km": "Energy per 100 km", "travel-time": "Travel time"