Fix percentage calculation.

Hi,
I fixed the percentage calculation. The old version calculated only 0 or 100 on Python 2.6.6 / 2.7.5+ due to integer division. If you cast one Integer to float, the calculation will be correct.