it is either you make you controlVar a double premitive type. or
cast what you have parse to int premitive type : controlVar = (int) Double.parseDouble(numberOfValues);

because your controlVar is...