code: private String format(double number, NFRuleSet ruleSet) {
          // all API format() routines that take a double vector through
          // here.  Create an empty string buffer where the result will
          // be built, and pass it to the rule set (along with an insertion
          // position of 0 and the number being formatted) to the rule set
          // for formatting
          StringBuilder result = new StringBuilder();
          if (getRoundingMode() != BigDecimal.ROUND_UNNECESSARY) {
              // We convert to a string because BigDecimal insists on excessive precision.
              number = new BigDecimal(Double.toString(number)).setScale(getMaximumFractionDigits(), roundingMode).doubleValue();
          }
          ruleSet.format(number, result, 0, 0);
          postProcess(result, ruleSet);
          return result.toString();
      }
docs: Bottleneck through which all the public format() methods
  that take a double pass. By the time we get here, we know
  which rule set we're using to do the formatting.
  @param number The number to format
  @param ruleSet The rule set to use to format the number
  @return The text that resulted from formatting the number