org.springframework.format.number

Class NumberStyleFormatter

    • Constructor Summary

      Constructors 
      Constructor and Description
      NumberStyleFormatter()
      Create a new NumberStyleFormatter without a pattern.
      NumberStyleFormatter(java.lang.String pattern)
      Create a new NumberStyleFormatter with the specified pattern.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method and Description
      java.text.NumberFormat getNumberFormat(java.util.Locale locale)
      Obtain a concrete NumberFormat for the specified locale.
      void setPattern(java.lang.String pattern)
      Specify the pattern to use to format number values.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • NumberStyleFormatter

        public NumberStyleFormatter()
        Create a new NumberStyleFormatter without a pattern.
      • NumberStyleFormatter

        public NumberStyleFormatter(java.lang.String pattern)
        Create a new NumberStyleFormatter with the specified pattern.
        Parameters:
        pattern - the format pattern
        See Also:
        setPattern(java.lang.String)
    • Method Detail

      • setPattern

        public void setPattern(java.lang.String pattern)
        Specify the pattern to use to format number values. If not specified, the default DecimalFormat pattern is used.
        See Also:
        DecimalFormat.applyPattern(String)
      • getNumberFormat

        public java.text.NumberFormat getNumberFormat(java.util.Locale locale)
        Description copied from class: AbstractNumberFormatter
        Obtain a concrete NumberFormat for the specified locale.
        Specified by:
        getNumberFormat in class AbstractNumberFormatter
        Parameters:
        locale - the current locale
        Returns:
        the NumberFormat instance (never null)