If you have to spend $5 in store to get a 4c/L discount on petrol, then you'd better be buying more than 125L of petrol, or else you just got screwed. For example, if your petrol was priced at $1.40 per litre and you filled up with 40 litres, that's a total cost of $56. If you buy $5 worth of chocolates to get the 4c discount, then your petrol is $1.36 per litre and your total cost is $59.40, or $3.40 more than you would have paid without getting the "discount". It's only when 4c per litre adds up to $5 that this becomes worthwhile. $5 divided by 4c/L gives 125 litres.
If you buy items you would have bought anyway, but at the higher petrol station prices, the calculation is more complicated. You only have to count the extra dollars you paid over supermarket prices for milk and bread and convert that into litres. Let's say you buy milk to get your discount, because you are running low at home. You pay $5 for 3L of milk but you would have paid $3 at the supermarket. That's an extra $2 you paid to get your petrol discounted by 4c/L. For that to be worthwhile, divide your $2 by the 4c/L discount and you need to be buying 50L of petrol to hit the break-even point. It's more plausible, but for me, personally, my car only has a 40L tank, so it is never worthwhile for me to spend $5 at the petrol station to get a 4c/L discount, even if it's something I already need.
Mokalus of Borg
PS - Dollars spent for the discount (D) = cents per litre discount (c) times litres bought (L).
PPS - Plug in the two numbers you know and solve for the remaining one to find out whether it's worthwhile.