Fix for cost calculations losing partial dollars

Casting $cost to an integer before turning to cents causes the float to drop it's decimal places.  Instead, the result of the math should be converted to cents.