Package org.springframework.format.number

# Class PercentStyleFormatter

java.lang.Object
org.springframework.format.number.AbstractNumberFormatter
org.springframework.format.number.PercentStyleFormatter

All Implemented Interfaces:
  `Formatter<Number>`, `Parser<Number>`, `Printer<Number>`

public class PercentStyleFormatter extends AbstractNumberFormatter
A formatter for number values in percent style.

Delegates to `NumberFormat.getPercentInstance(Locale)`. Configures BigDecimal parsing so there is no loss in precision. The `AbstractNumberFormatter.parse(String, Locale)` routine always returns a BigDecimal.

Since:
  4.2
Author:
  Keith Donald, Juergen Hoeller
See Also:
  - `AbstractNumberFormatter.setLenient(boolean)`

## Constructor Summary

Constructors
Constructor
Description
`PercentStyleFormatter()`

## Method Summary

Modifier and Type
Method
Description
`protected NumberFormat`
`getNumberFormat(Locale locale)`
Obtain a concrete NumberFormat for the specified locale.

### Methods inherited from class org.springframework.format.number.AbstractNumberFormatter

`parse, print, setLenient`

### Methods inherited from class java.lang.Object

`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

## Constructor Details

### PercentStyleFormatter

public PercentStyleFormatter()

## Method Details

### getNumberFormat

protected NumberFormat getNumberFormat(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`)