Class NumberStyleFormatter

java.lang.Object
org.springframework.format.number.AbstractNumberFormatter
org.springframework.format.number.NumberStyleFormatter
All Implemented Interfaces:
Formatter<Number>, Parser<Number>, Printer<Number>

public class NumberStyleFormatter extends AbstractNumberFormatter
A general-purpose number formatter using NumberFormat's number style.

Delegates to NumberFormat.getInstance(Locale). Configures BigDecimal parsing so there is no loss in precision. Allows configuration over the decimal number pattern. The AbstractNumberFormatter.parse(String, Locale) routine always returns a BigDecimal.

Since:
4.2
Author:
Keith Donald, Juergen Hoeller
See Also:
  • Constructor Details

    • NumberStyleFormatter

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

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