fleetmap-reports 2.0.380 → 2.0.382

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/lang/enGB.js CHANGED
@@ -7,7 +7,7 @@ module.exports = {
7
7
  report_trip_title: 'Trip Report',
8
8
  report_location_title: 'Location Report',
9
9
  report_zone_crossing: 'Zone Report',
10
- report_speeding: 'Relatório de Excessos de Velocidade',
10
+ report_speeding: 'Relatório de excès de vitesse',
11
11
  report_speeding_beta: 'Relatório de Excessos de Velocidade BETA',
12
12
  report_tolls: 'Relatório de Portagens',
13
13
  settings: 'Settings',
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "fleetmap-reports",
3
- "version": "2.0.380",
3
+ "version": "2.0.382",
4
4
  "description": "",
5
5
  "main": "src/index.js",
6
6
  "scripts": {
@@ -252,7 +252,7 @@ function getOdooAvgConsumption (day, allRefuelingPositions, trips) {
252
252
  }
253
253
 
254
254
  function getCanAvgConsumption (distance, spentFuel) {
255
- if (distance === 0 || spentFuel === 0) { return { byKms: 0, byLiters: 0 } }
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
- return Number(value.toFixed(1))
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) {