Why cast the percentage to an int?  You could use a float here.