<div dir="ltr">Hi all,<br><div>Some of the code I copied from Kona/Kia code had both kwh/100km and km/kwh metrics in the code as 'Other'. </div><div>Adding the various power consumption Units is not particularly hard (I will have a pull-request soon) - though the conversions between them all required some thought!</div><div>... but it also made me think these two metrics that are (with the consumption units added) defined like this:  </div><div><font face="monospace">m_v_trip_consumption1 = MyMetrics.InitFloat("xiq.v.trip.consumption.KWh/100km", 10, 0, kWHP100K);<br>m_v_trip_consumption2 = MyMetrics.InitFloat("<a href="http://xiq.v.trip.consumption.km/kWh">xiq.v.trip.consumption.km/kWh</a>", 10, 0, kPkWH);<br></font></div><div><br></div><div>These are effectively the same metric but in different units!</div><div>I'm wondering if we would be better to have scripting and Duktape support for converting metrics to different unit!  This might be also quite useful for those strange countries that insist on using miles as a measurement.</div><div><br></div><div>On top of the 'metric list' and 'metric set' we could add a 'metric get' which gets a single value.. and add unit support for get/set.</div><div><br></div><div>I've also got a pull request that improves the precision of the km<->mi conversions and factors it out.</div><div><br></div><div>//.ichael</div></div>