code: public static boolean isAllNumber(String str) {
      	boolean hasNumber = false;
  		for (int i = 0; i < str.length(); i++) {
  		    if (!(Character.isDigit(str.charAt(i)) || 
  				str.charAt(i) == '.' || str.charAt(i) == ',' || str.charAt(i) == '%'
  				|| str.charAt(i) == '$' || str.charAt(i) == '_')) {
  			return false;
  		    }
  		    else if (Character.isDigit(str.charAt(i)))
  		    	hasNumber = true;
  		}
  		
  		if (hasNumber == true)
  			return true;
  		else return false;		
      }
docs: Checks if is all number.
  
  @param str the string
  @return true, if str consists all numbers