1---
2version: 0.1.0
3precision: 3
4form_title: Worth the drive to a cheaper gas station?
5form_description: Enter your car's consumption, the one-way distance to the other station, your local price and how much fuel you plan to buy — get the price (and price gap) that makes the detour actually pay off. Tap the form icon.
6form_inputs: Consumption|consumption{L/100km}, Distance one-way|distance{km}, Local price|price_local{€/L}, Fuel to buy|liters{L}
7form_outputs: Extra fuel for the detour (L)|detour_fuel, Extra cost of the detour (€)|detour_cost, Min. price difference (€/L)|min_diff, Max. price worth driving to (€/L)|breakeven_price
8---
9# draftply Pro — Worth the drive to a cheaper gas station?
10# The other station's price alone doesn't decide it: driving there and back
11# burns fuel too, and that detour cost is fixed while your savings scale with
12# how much you actually buy. This notebook also has a FORM (Pro): tap the
13# form icon for an input mask.
14
15consumption = 7 L/100km # your car's fuel use
16distance = 8 km # one-way to the other station
17price_local = 1.85 €/L # at your local station
18liters = 40 L # you plan to refuel
19
20# ── The detour itself costs fuel ───────────────
21# consumption already carries the /100km scaling as a unit, so no manual
22# "/ 100" here — that would divide by 100 twice.
23detour_km = distance * 2 # there and back
24detour_fuel = detour_km * consumption
25detour_cost = detour_fuel * price_local
26
27# ── Break-even ──────────────────────────────────
28# The price gap has to cover the detour cost across the litres you buy.
29min_diff = detour_cost / liters
30breakeven_price = price_local - min_diff
31
32"Extra fuel for the detour (L)": detour_fuel
33"Extra cost of the detour (€)": detour_cost
34"Min. price difference (€/L)": min_diff
35"Max. price worth driving to (€/L)": breakeven_price
36
37The trip pays off once the other station's price drops below {breakeven_price} €/L.
38