fuel spent

jay4 years ago

Hello. just want to find out on the below formula. 9999999 - 17 * totalDistance / 100000
Does 17 means the cost per liter of fuel. thank you

Anton Tananaev4 years ago

It means 17 liters per 100km.

jay4 years ago

Does one have to restart traccar service once fuel attribute is set.

junk2 years ago

I have found solution to calculate the spent fuel for a trip on the trip report. Edit the template of the report trip.xlsx located in templates of the traccar directory. Place in cell Fuel spent- ${distanceUnit.equals("mi") ? "".format("%.1f mi", trip.distance * 0.0065) : distanceUnit.equals("nmi") ? "".format("%.1f nmi", trip.distance * 0.065 / 1000) : "".format("%.1f l", trip.distance * 0.065 / 1000)}
replace the number 0.065 with yours average consumption of the fuel.

jay2 years ago

Thank you junk. This formula is in miles. Can you do a formula in km's. Thank you