Class ValueFormatter
java.lang.Object
org.eclipse.birt.chart.computation.ValueFormatter
This class handles the formatting work of any data value.
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic String
format
(Object oValue, FormatSpecifier formatSpecifier, com.ibm.icu.util.ULocale lcl, Object oCachedJavaFormatter) Returns the formatted string representation of given object.static String
getNumericPattern
(double dValue) Returns an auto computed decimal format pattern for category data or axis label.static String
getNumericPattern
(Number num) Returns an auto computed number pattern.static Number
normalizeDouble
(Double value) Normalize double value to avoid error precision.static Number
normalizeDouble
(Double dValue, String pattern) static FormatSpecifier
resetFormatSpecifier
(Object oValue, FormatSpecifier fs) Under some cases, the specified format specifier is not suitable for current value, the format specifier must be reset to fit current value.
-
Field Details
-
DECIMAL_FORMAT_PATTERN
- See Also:
-
-
Constructor Details
-
ValueFormatter
public ValueFormatter()
-
-
Method Details
-
format
public static String format(Object oValue, FormatSpecifier formatSpecifier, com.ibm.icu.util.ULocale lcl, Object oCachedJavaFormatter) throws ChartException Returns the formatted string representation of given object.- Parameters:
oValue
-formatSpecifier
-lcl
-- Returns:
- formatted string
- Throws:
ChartException
-
resetFormatSpecifier
Under some cases, the specified format specifier is not suitable for current value, the format specifier must be reset to fit current value.- Parameters:
oValue
-fs
-- Returns:
- format specifier.
-
getNumericPattern
Returns an auto computed number pattern.- Parameters:
num
- number value- Returns:
- number pattern
- Since:
- 2.5.3
-
getNumericPattern
Returns an auto computed decimal format pattern for category data or axis label. If it's an integer, no decimal point and no separator. This is also used for representing logarithmic values.- Returns:
- numeric pattern
-
normalizeDouble
Normalize double value to avoid error precision.- Parameters:
value
-- Returns:
- normalized value of specified double.
-
normalizeDouble
-