storing and displaying prices

I have some prices held in number fields on a database but they aren’t held to 2 decimal places, so a price of 12.00 is held as 12 and 10.50 is held as 10.5.
This would be OK if I could display them correctly on the page, but I can’t find a way to do that.

I guess there is a simple solution to this, since the majority of sites need to display prices.