code: protected static String negify(String pattern) {
          if (pattern.contains(";")) return pattern;
          else {
              if (pattern.contains("-"))
                  throw new IllegalStateException("Positive pattern contains negative sign");
              // the regex matches everything until the first non-quoted number character
              return pattern + ";" + pattern.replaceFirst("^([^#0,.']*('[^']*')?)*", "$0-");
          }
      }
docs: Guarantee a formatting pattern has a subpattern for negative values.  This method takes
  a pattern that may be missing a negative subpattern, and returns the same pattern with
  a negative subpattern appended as needed.
  
  <p>This method accommodates an imperfection in the Java formatting code and distributed
  locale data.  To wit: the subpattern for negative numbers is optional and not all
  locales have one. In those cases, {@link DecimalFormat} will indicate numbers
  less than zero by adding a negative sign as the first character of the prefix of the
  positive subpattern.
  
  <p>We don't like this, since we claim the negative sign applies to the number not the
  units, and therefore it ought to be adjacent to the number, displacing the
  currency-units indicator if necessary.