How much does it cost to feed a rodent?
Pocket pets like rats, mice, hamsters, gerbils are very economical to care for. The most expensive item will be the housing, eg. cage, running wheel, water bottle, house hide and maybe hamster ball. As for food, you actually don't need to buy commercial food but if you want, a small bag or box of pellets could last a month or more. You can feed corn flakes, cheerios, plain pop corn, nuts of all kinds, fresh vegetables, occasionally small pieces of cheese, chicken, beef, tuna, dog kibble, eggs, parrot biscuits and very small amounts of almost anything that you eat.
I'd be more worried about paying the vets bills if your prospective pet falls ill.
Feeding small rodents is pretty cheap. Not something you even need to worry about. Maybe $5 a month. What you do need to worry about is vet bills. You cannot feed random food items. You can feed a homemade diet but it needs to be balanced. If you want to feed a homemade diet you need to do research first.