local gearT = {
    [-1] = "R",
    [0] = "N",
    [1] = "1",
    [2] = "2",
    [3] = "3",
    [4] = "4",
    [5] = "5",
    [6] = "6",
    [7] = "7",
    [8] = "8"
    
}

local fuelConsumption = 0.00050 -- Fetch this from car.ini/[FUEL] section (couldn't figure out ac.readDataFile())
local currentLitersAvailable = car.fuel
local maxMiles = 440.96 -- Maximum range for the car to drive with a full tank (in miles) 

currentLiters100 = (car.rpm * car.gas * fuelConsumption)/1000 --Fuel consumption. In one second the consumption is (rpm*gas*CONSUMPTION)/1000 litres
currentLitersAvailable = car.fuel - currentLiters100 --Current liters available in the tank
currentRange = math.max(0,currentLitersAvailable * maxMiles/90) --Current mileage range


local white = rgb(1,1,1)

function update(dt)
    display.text({ text = math.floor(car.speedKmh/1.609344), pos = vec2(880, 883.2), letter = vec2(60, 120), font = 'ttcup', color = white, alignment =0.5, width = 251, spacing = 1})
    display.text({ text = math.round(currentRange), pos = vec2(140.1, 795.7), letter = vec2(15, 30), font = 'digital_big', color = white, alignment =1, width = 0, spacing = .01 })
    display.text({ text = gearT[car.gear], pos = vec2(925.6, 350.6), letter = vec2(125,250), font = 'ttcup', color = white, alignment =0, width = 0, spacing = 1 })
    display.text({ text = string.format("%05d", car.distanceDrivenTotalKm), pos = vec2(819.8, 863), letter = vec2(15, 30),font = "fonts/hyperion", color = white, alignment =0.0, width = 0, spacing = 0 })
    display.text({ text = string.format("%05.1f", car.distanceDrivenSessionKm), pos = vec2(0, 0), letter = vec2(25, 50), font = 'e92_big', color = white, alignment =0.0, width = 0, spacing = 1 })
   end



  
   