1. A computer-implemented method for calculating fuel consumption in an engine connected to an engine controller unit and using a type of fuel, the method comprising the computer-implemented steps of: obtaining data relating to the engine from the engine controller unit; inferring the fuel type from the data; selecting an algorithm based on the fuel type, from a plurality of algorithms; and calculating the fuel consumption using the selected algorithm; wherein the data does not directly specify the fuel type; wherein the fuel type is inferred from data comprising one or more of: dwell time, injection pressure, absolute load value, short term trim and long term trim; and wherein the fuel type is inferred using fuzzy logic.