code: public static StringBuilder format(String compiledPattern, CharSequence value,
              StringBuilder appendTo, FieldPosition pos) {
          int[] offsets = new int[1];
          SimpleFormatterImpl.formatAndAppend(compiledPattern, appendTo, offsets, value);
          if (pos.getBeginIndex() != 0 || pos.getEndIndex() != 0) {
              if (offsets[0] >= 0) {
                  pos.setBeginIndex(pos.getBeginIndex() + offsets[0]);
                  pos.setEndIndex(pos.getEndIndex() + offsets[0]);
              } else {
                  pos.setBeginIndex(0);
                  pos.setEndIndex(0);
              }
          }
          return appendTo;
      }
docs: Formats the pattern with the value and adjusts the FieldPosition.