Jason Lamb .ME Some stuff I think is cool and interesting, you might too!

October 16, 2026

Building an MPG Tracker That Understands Partial Fill-Ups

Filed under Informational

A fuel log sounds simple: enter the odometer, enter the gallons, calculate miles per gallon. Then real life shows up with a partial fill, a blurry receipt, and an entry you forgot to make until you got home.

The MPG Fuel Log Tracker is built around those less tidy situations. It keeps per-vehicle records for mileage, gallons, price, total cost, station, location, and comments. Entries can be made manually or with a photo-assisted workflow that accepts up to four images, such as the odometer, pump totals, and station signage.

The key calculation is full-to-full MPG. A partial fill remains in the history as a real purchase, but it does not receive a misleading standalone MPG value. When the next full fill arrives, the app uses the distance since the previous full fill and all the gallons added in between.

Corrections need the same care. Editing or deleting an older entry rebuilds dependent mileage and MPG results. Otherwise, fixing one typo could leave the rest of the chart quietly wrong.

Station information has grown beyond a free-text label. The app supports learned brands and reusable physical station profiles, including nicknames and addresses. Optional browser GPS or available JPEG location metadata can help locate nearby stations, but the user confirms the actual station before it is saved. Saved stations also make later entry possible without pretending the phone is still at the pump.

A map adds context to the history, while station analytics help compare recorded prices and spending. Export keeps the information available outside the app.

Small details in this project reinforce one another. Better entry produces better records; correct calculations make the chart worth looking at. The dashboard is the visible result, but handling an ordinary partial fill correctly is essential to reliable results.

Open the hosted project · Explore the project on GitHub

Update history

These notes record article updates associated with repository changes. The original publication date is retained.

  • — Converted automated article narration to neutral third person and added public update history. No application functionality changed. GitHub source