Class ValueFormatter

java.lang.Object
org.eclipse.birt.chart.computation.ValueFormatter

public final class ValueFormatter extends Object
This class handles the formatting work of any data value.
  • Field Details

  • 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

      public 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.
      Parameters:
      oValue -
      fs -
      Returns:
      format specifier.
    • getNumericPattern

      public static String getNumericPattern(Number num)
      Returns an auto computed number pattern.
      Parameters:
      num - number value
      Returns:
      number pattern
      Since:
      2.5.3
    • getNumericPattern

      public static String getNumericPattern(double dValue)
      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

      public static Number normalizeDouble(Double value)
      Normalize double value to avoid error precision.
      Parameters:
      value -
      Returns:
      normalized value of specified double.
    • normalizeDouble

      public static Number normalizeDouble(Double dValue, String pattern)