code: public static int getPercentage(String percentage) {
          if (isNotEmpty(percentage) && isNumeric(percentage)) {
              int p = Integer.parseInt(percentage);
              return p;
          } else {
              return 0;
          }
      }
docs: Takes a numeric string value and converts it to a integer between 0 and 100.
  
  returns 0 if the string is not numeric.
  
  @param percentage - A numeric string value
  @return a integer between 0 and 100