Because the conversion to float happens after the division has been done. You need:
float percentage = ((float) totalOptCount) / totalRespCount;
You should be able to format using something like:
String str = String.format("%2.02f", percentage);
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…