How to get the last penny? :P

Do a search for rounding there are several tutorials on it.

Here is a good tutorial for you.