fleetmap-reports 2.0.380 → 2.0.381
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json
CHANGED
|
@@ -252,7 +252,7 @@ function getOdooAvgConsumption (day, allRefuelingPositions, trips) {
|
|
|
252
252
|
}
|
|
253
253
|
|
|
254
254
|
function getCanAvgConsumption (distance, spentFuel) {
|
|
255
|
-
if (distance
|
|
255
|
+
if (!distance || !spentFuel) { return { byKms: 0, byLiters: 0 } }
|
|
256
256
|
|
|
257
257
|
return calculateAvgConsumption(spentFuel, distance)
|
|
258
258
|
}
|
package/src/util/utils.js
CHANGED
|
@@ -43,7 +43,8 @@ function convertMS (duration, withSeconds) {
|
|
|
43
43
|
}
|
|
44
44
|
|
|
45
45
|
exports.formatNumber = function formatNumber (value) {
|
|
46
|
-
|
|
46
|
+
const num = Number(value)
|
|
47
|
+
return Number.isFinite(num) ? Number(num.toFixed(1)) : 0
|
|
47
48
|
}
|
|
48
49
|
|
|
49
50
|
function coordsDistance (lon1, lat1, lon2, lat2) {
|