Following is the detail about how to calculate the mpg of a car:
[highlight]How to Measure Fuel Consumption
Fill the petrol in the fuel tank until gas vapours can be seen in the fuel inlet pipe.
Once the gas vapours can be seen in the fuel inlet pipe wait for about 20~30 seconds and if possible wait for more than a minute for more accurate calculation.
Do not shake the vehicle's body.
As soon as the gas vapours sinks add more petrol till the gas surface is visible once again.
Initialize the trip meter to zero at the petrol pump.
Drive the vehicle till the fuel gauge needle reaches the 'E' Position. Ensure that no petrol has been added in between.
Repeat steps 1~4 again.
Read the petrol quantity from the pump.
Read the mileage from the trip meter.
Calculate the fuel consumption. (Trip meter mileage - Petrol quantity)
After calculating the fuel consumption, once again initialize the trip meter to zero.
Repeat the above procedure at least 5~6 times.
Calculate the average fuel consumption.
[/highlight]
Courtesy: http://www.toyota-indus.com/hints/maintenance.asp