Code example for DecimalFormat

Methods: setParseBigDecimal

0
  /** 
   * DefaultConstructor, this object is initialized using a DecimalFormat with the default pattern for this locale. 
   */ 
  public DecimalFormatParser() 
  { 
    setFormatter(new DecimalFormat());
  } 
 
  /** 
   * Returns the format for the filter. The DecimalFormatParser has only DecimalFormat objects assigned. 
   * 
   * @return the formatter. 
   */ 
  public DecimalFormat getDecimalFormat()
  { 
    return (DecimalFormat) getFormatter();
  } 
 
  /** 
   * Sets the format for the filter. 
   * 
   * @param format the format. 
   * @throws NullPointerException if the given format is null. 
   */ 
  public void setDecimalFormat(final DecimalFormat format)
  { 
    setFormatter(format);
  } 
 
  /** 
   * Sets the format for the filter. If the given format is no Decimal format, a ClassCastException is thrown 
   * 
   * @param format The format. 
   * @throws NullPointerException if the given format is null 
   * @throws ClassCastException   if the format is no decimal format 
   */ 
  public void setFormatter(final Format format)
  { 
    if (format == null)
    { 
      throw new NullPointerException("The number format given must not be null.");
    } 
    final DecimalFormat dfmt = (DecimalFormat) format;
    dfmt.setParseBigDecimal(true);
    super.setFormatter(dfmt);
  } 
 
  /** 
   * Synthesizes a pattern string that represents the current state of this Format object. 
   * 
Connect your IDE to all the code out there  Get Codota for Java