When deciding whether to drive further for cheaper groceries, the gas cost is usually the smallest term. Worked example (hypothetical, plug in your own numbers): a 3 km detour each way burns ~0.5 L of fuel, call it $1.20. The farther store saves $8 on a big shop. So the visible gain is ~$6.80, plus ~8 extra minutes.
Now the part people skip: whether it's worth it depends almost entirely on one assumption, how you value your time. At $10/hour, 8 minutes is ~$1.33, still clearly worth it. At $60/hour, it's a small loss. The fuel price barely moves the answer; the hourly rate does.
So the real question isn't the price gap. It's what your time is worth, and most of us can't state that number out loud.