From d918f946ca610c8e68ee75e6a6df791020e5f9f5 Mon Sep 17 00:00:00 2001 From: BennyDaBee <97147515+BennyDaBee@users.noreply.github.com> Date: Tue, 14 Jun 2022 08:54:02 -0500 Subject: [PATCH 1/3] Update measurement.js Add conversion to gallons for non EV --- src/measurement.js | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/src/measurement.js b/src/measurement.js index 35ec1dc..473ef77 100644 --- a/src/measurement.js +++ b/src/measurement.js @@ -7,6 +7,8 @@ class Measurement { 'km', 'kPa', 'km/l(e)' + // Helps with conversion to Gallons. + 'lit' ]; constructor(value, unit) { @@ -35,6 +37,8 @@ class Measurement { case 'volts': case 'Volts': return 'V'; + case 'l': + return 'lit'; // these are states case 'Stat': case 'N/A': @@ -65,6 +69,8 @@ class Measurement { case 'km/l(e)': // km/L = (1.609344 / 3.785411784) * MPG value = _.round(value / (1.609344 / 3.785411784), 1); + case 'lit': + value = _.round(value / 3.785411784, 1); break; } return value; @@ -85,6 +91,8 @@ class Measurement { return 'psi'; case 'km/l(e)': return 'mpg(e)'; + case 'lit': + return 'gal'; default: return unit; } @@ -95,4 +103,4 @@ class Measurement { } } -module.exports = Measurement; \ No newline at end of file +module.exports = Measurement; From 37e294330f46260d49d3be8520f4d49d9ca1631b Mon Sep 17 00:00:00 2001 From: BennyDaBee <97147515+BennyDaBee@users.noreply.github.com> Date: Tue, 21 Jun 2022 21:29:31 -0500 Subject: [PATCH 2/3] Update measurement.js --- src/measurement.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/measurement.js b/src/measurement.js index 473ef77..2d428f5 100644 --- a/src/measurement.js +++ b/src/measurement.js @@ -6,7 +6,7 @@ class Measurement { '°C', 'km', 'kPa', - 'km/l(e)' + 'km/l(e)', // Helps with conversion to Gallons. 'lit' ]; From b6812d377bbc78b67170fccb94a62be3e77d34d8 Mon Sep 17 00:00:00 2001 From: Michael Woods Date: Wed, 22 Jun 2022 20:51:20 -0400 Subject: [PATCH 3/3] Update measurement.js --- src/measurement.js | 1 + 1 file changed, 1 insertion(+) diff --git a/src/measurement.js b/src/measurement.js index 2d428f5..385e696 100644 --- a/src/measurement.js +++ b/src/measurement.js @@ -69,6 +69,7 @@ class Measurement { case 'km/l(e)': // km/L = (1.609344 / 3.785411784) * MPG value = _.round(value / (1.609344 / 3.785411784), 1); + break; case 'lit': value = _.round(value / 3.785411784, 1); break;