private void setNumberFormat(String newNumberFormat) throws IllegalArgumentException {
    newNumberFormat = newNumberFormat.trim();

    if (!newNumberFormat.startsWith("%")) {
      throw new IllegalArgumentException("Number format not starting with %\n");
    }

    if ((!newNumberFormat.endsWith("f")) && (!newNumberFormat.endsWith("e")) && (!newNumberFormat.endsWith("E")) && (!newNumberFormat.endsWith("g")) && (!newNumberFormat.endsWith("G")) && (!newNumberFormat.endsWith("m"))) {
      throw new IllegalArgumentException("Number format not recognized%\n");
    }

    if (newNumberFormat.endsWith("m")) {
      sFormatter = new INDISexagesimalFormatter(newNumberFormat);
    }

    this.numberFormat = newNumberFormat;
  }