Not a bug

Cost per mile doesn't make sense

Rob 6 years ago updated 3 years ago 13

Not sure how it is calculated.  Just spent $189.72 to fillup after 455 miles.

Cost per mile in app shows $0.402/mile

I think it should be $0.417 /mile

Am I missing something?

Under review


Why do you think so?

It's not so easy. You can divide it by fuel price from last fillup. In the last fillup fuel you get will be used in future so you need to take fuel amount (gallons or litres) and fuel price from previous fillup

Thanks for the response!  Why is it not so easy?  To me, a cost per distance is very easy - it is simply the cost divided by distance traveled.  As I mentioned before, if I traveled 455 miles since the last fill-up, and it cost me $189.72 to fill, then my cost per distance between those fill-ups  is $189.72 / 455 = $0.417/mile, NOT 0.402

Maybe the cost per mile feature means something different to you?

Thanks again,


Yes. but this is wrong. Like I wrote. This is it. Only you need to use fuel price from previous fillup (not the last one).

Take total cost from last fillup - then take fuel amount and take fillup from previous fillup. And that's it. You are calculating this with fuel you are getting in the last fillup - but this is fuel you'll use in future. So the only change is taking fuel price from previous fillup. And that's correct.

Allright, it's your app, do it the way you want to.  I see why you say your calculation is not so easy - because it is not realistic or rational.

Consider a situation that you fill up with 20 gallons, at $2.50 per gallon.  

Then you drive 400 miles, you stop and fill up with 75 gallons, at $3.00 per gallon.

By my method,  it cost you $225 to replace the fuel you used to drive 400 miles, so your cost per mile is $0.5625

By your method, the first 20 gallons you have used is at $2.50 per gallon, so the first 20 gallons equal $50, now what price do you use for the other 55 that you have used?  Do you look to the next previous fillup, or do you assume the same price?  

Like I said first, it's your app, make it the way you want it, but don't tell me I'm wrong about the way to calculate it.  Your method of calculating maybe useful to you, but it is completely useless to me.

I like everything else about the app, it works great and does what I need.  This is the only piece of data that is not meaningful or useful for me.

Not sure I understand this.

Maybe you can provide some screenshot to explain this.

Would be great. I'm always open to comments and discussion. I've implemented this after talking and getting feedback from many users (lots of truck drivers). 

In most cases it's better to use this algorithm that is in Fuelio.

Fuelio is showing this for full fillups. And this is important in this case. In most cases the situation when you are filling your vehicle is you are running out of fuel - or close to this. Let's say even 1/4. Then you are filling up 75 gal to FULL (full is control point). You get this 75 gal for 3$ but actually this is the amount you have used by using fuel added with the previous fillup. And if your tank is even 100 gallons - it's still much better to get the price from the previous fillup. 

For first two years it was just total cost/ fuel amount. But like I said - I was getting a lot of complaints that this is wrong. We changed it. And like I said - for most cases this should be much better and more accurate than the mothod of claculating with the price from the last fillup. I used "most cases" because you are right that in some situations this can be more complicated. 

Maybe I'm missing here somethinh that's why screenshot can be useful to see the situation, your tank size etc.


I agree with the OriginalPoster. So how about making it a setting?


1) Calculate using the old price of gas used from the tank  (price at previous fill-up);


2) Calculate using new price to replace gas used (current price for this fill-up).

#2 Provides the cost to make the vehicle ready for the next trip. To me, _that_ is the cost of the driving trip I just did - not whatever I may have paid in the past so the vehicle was ready when I wanted it this time. I must restore the vehicle to readiness again because I have emptied the tank on this trip I just made; that cost to restore the vehicle is determined by the current price of the gas I put in now. _That_ is the cost of the trip I just made, now; whatever I paid in the past doesn't determine what I have to pay now for the driving I just did. If I find low priced gas to fill the tank, the trip cost me less. If I have to fill at a higher price, the trip cost me more. What I paid last time (last month, in another town, whatever) doesn't affect what my trip just cost me. That is the cost that matters to me. 

But, as I say: Why not have it both ways by putting in a setting for this calculation:?



Cost per mile in Fuel Log

It is calculated using price from previous fillup. 
It's fuel amount * fuel price from previous fillup - because price in the last fillup is price for fuel you'll use in future.

Option for #2 is planned for future verions.

Also, by the trip cost you mean the new module. I want to connect this. Right now for TripLog you can set fixed value or use avg cost/km.



I went through this with Adrian before, he just doesn't look at it the way we do.  His method isn't any more accurate, but he refuses to change or even give an option like you suggested.  I gave up trying to explain it to him.  

FYI. Option for @rlaggren #2 is planned as an option for future version. Current method for 90% cases is the most accurate one (used in many fleet management spreadsheets, apps). This will be default one but in future you'll have setting for this. 


That is really great if you can put in a setting to allow using the fuel price of the "current" fill up!

This question is actually addressed by classical accounting procedures. There are different ways to price inventory and other assets/liabilities and the business selects the best way for it's purposes when it's setting up the books. There are 3 or 4 different ways to account for costs/prices and legitimate reasons for all of them.



It's been three years now and I still haven't seen the second option.  Is this ever going to happen?