In this line, you are doing an integer division, not a floating point division (even though zoomPercentage is a float). The result of the integer division is 0 and that's converted to a float.

Convert at least one of the numbers in the division to a float: