code: private boolean isGroupingPosition(int pos) {
          boolean result = false;
          if (isGroupingUsed() && (pos > 0) && (groupingSize > 0)) {
              if ((groupingSize2 > 0) && (pos > groupingSize)) {
                  result = ((pos - groupingSize) % groupingSize2) == 0;
              } else {
                  result = pos % groupingSize == 0;
              }
          }
          return result;
      }
docs: Returns true if a grouping separator belongs at the given position, based on whether
  grouping is in use and the values of the primary and secondary grouping interval.
  
  @param pos the number of integer digits to the right of the current position. Zero
  indicates the position after the rightmost integer digit.
  @return true if a grouping character belongs at the current position.