code: public static boolean isDouble(String _str, char _separator, boolean _allowNegative) {
          String pattern = "\\d+XXX\\d+$";
          if (_separator == '.') {
              pattern = pattern.replace("XXX", "\\.?");
          } else {
              pattern = pattern.replace("XXX", _separator + "?");
          }
  
          if (_allowNegative) {
              pattern = "^-?" + pattern;
          } else {
              pattern = "^" + pattern;
          }
  
          if (_str != null) {
              return _str.matches(pattern) || isInteger(_str, _allowNegative);
          }
          return false;
      }
docs: Checks if the given string is a valid double.
  @param _str string to validate
  @param _separator seperator used (e.g. "." (dot) or "," (comma))
  @param _allowNegative set to true if negative double should be allowed
  @return true if given string is double, false otherwise