The formulas
Metric: litres = distance × (L/100 km) ÷ 100
Miles per gallon: gallons = distance ÷ mpg
The cost is the fuel used multiplied by the price. In the UK setting, gallons are converted to litres because fuel is sold by the litre.
Worked example
A 250 km journey in a car that uses 6.5 L/100 km takes 250 × 6.5 ÷ 100 = 16.25 litres. At 1.60 a litre, that costs 26.00.
UK and US gallons differ
A UK (imperial) gallon is 4.546 litres and a US gallon is 3.785 litres. The same car therefore shows a higher mpg figure in UK gallons than in US gallons, so choose the setting that matches where the figure came from.
Real consumption varies with speed, load, traffic and weather, so treat the result as an estimate.