org.hrodberaht.i18n.formatter
Class PercentageFormatter
java.lang.Object
org.hrodberaht.i18n.formatter.Formatter
org.hrodberaht.i18n.formatter.NumberFormatter
org.hrodberaht.i18n.formatter.PercentageFormatter
public class PercentageFormatter
- extends NumberFormatter
Simple Java Utils
- Since:
- 1.0
- Version:
- 1.0
- Author:
- Robert Alexandersson
|
Field Summary |
static int |
PERCENTAGE_SCALE
The default scale for percentage values |
|
Method Summary |
Object |
convertToObject(String target)
Unformats its argument and returns a BigDecimal instance
initialized with the resulting string value |
String |
convertToString(Object value)
Returns a string representation of its argument, formatted as a
percentage value. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
PERCENTAGE_SCALE
public static final int PERCENTAGE_SCALE
- The default scale for percentage values
- See Also:
- Constant Field Values
PercentageFormatter
public PercentageFormatter()
convertToObject
public Object convertToObject(String target)
- Unformats its argument and returns a BigDecimal instance
initialized with the resulting string value
- Overrides:
convertToObject in class Formatter
- Returns:
- a BigDecimal initialized with the provided string
convertToString
public String convertToString(Object value)
- Returns a string representation of its argument, formatted as a
percentage value.
- Overrides:
convertToString in class Formatter
- Returns:
- a formatted String
Copyright © 2011. All Rights Reserved.