Update measurement.js

This commit is contained in:
BennyDaBee 2022-08-15 14:15:30 -05:00 committed by GitHub
parent 2e5f9621f8
commit fdba453f9c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -6,7 +6,7 @@ class Measurement {
'°C',
'km',
'kPa',
'km/l(e)',
'km/l',
// Helps with conversion to Gallons.
'lit'
];
@ -32,12 +32,12 @@ class Measurement {
return 'km';
case 'KPa':
return 'kPa';
case 'kmple':
return 'km/l(e)';
case 'kmpl':
return 'km/l';
case 'volts':
case 'Volts':
return 'V';
case 'l':
case 'L':
return 'lit';
// these are states
case 'Stat':
@ -66,7 +66,7 @@ class Measurement {
case 'kPa':
value = _.round(convert(value).from('kPa').to('psi'), 1);
break;
case 'km/l(e)':
case 'km/l':
// km/L = (1.609344 / 3.785411784) * MPG
value = _.round(value / (1.609344 / 3.785411784), 1);
break;
@ -90,8 +90,8 @@ class Measurement {
return 'mi';
case 'kPa':
return 'psi';
case 'km/l(e)':
return 'mpg(e)';
case 'km/l':
return 'mpg';
case 'lit':
return 'gal';
default: