Mazdaspeed3 / Mazda 3 MPS is equipped with on-board computer. Simply press INFO button for a while and you can read actual fuel consumption, average fuel consumption, average speed and the approximate range on owned fuel. But I found information that on-board domputer is not enabled in some versions of Mazda 3. Normally in versions below Grand Touring you have to pay for that, but for some reason it is trivially easy to unlock it. Probably this works on 2006 and later models, but why not to try this trick? After all, it will not explode ;)