AlfHou / hammond

Self hosted vehicle and expense management system. Like Clarkson, but better
GNU Affero General Public License v3.0
132 stars 19 forks source link

Feature Request: Fuel Economy Displays for Summary Card and Details #28

Open AlfHou opened 1 year ago

AlfHou commented 1 year ago

Original by @KLMors3 from the original repo Adding fuel economy based on users currency/fuel metric to the Summary card and Details page would be very beneficial for quick glances if the data is available.

I think the logic could be to subtract the second to the last complete fuel up (as marked by the "Tank Full" toggle) from the last complete fuel up, and then divide that amount traveled by the Last Fuel Qty. If there is not concurrent complete fuel up data to calculate the last fuel economy it could simply say "NA" or "Partially Filled Up" This method removes the need for a static fuel tank size to be stored

Here are Screenshots of what I had in mind. image

I replaced the currency with AVG Fuel Economy as the currency is always static for my uses, so I don't need to know that info at a glance. Additionally, is it possible to limit the number length display to 5 characters? "AVG Fillup QTY" is longer than it needs to be. image

I have mocked up what the details page could look like. The "Fuel Economy" can be calculated like I mentioned above for each entry, and the "AVG Fuel Economy" is calculated by adding all of the completed fuel economy values and then dividing that number by the total completed amount of entries. For example: 19.246+15.976+18.651 / 3 = "17.957" image

marc115uk commented 1 year ago

As we are an odd bunch in uk, we buy fuel in litres but calculate our fuel economy in imperial mpg, would it be possible to have an option to have a setting that in the fuel up page we add litres, however if this new feature is added we can display it as imperial mpg? Thanks