Class NumericConfig


  • public class NumericConfig
    extends Object
    A NumericConfig encapsulates number formatting options for expression evaluation. The default US_NUMERIC_CONFIG instance provides US specific locale configuration. Databases which have been built for other locales can utilize custom implementations of NumericConfig in order to evaluate expressions correctly.
    Author:
    James Ahlborn
    • Field Detail

      • US_NUMERIC_CONFIG

        public static final NumericConfig US_NUMERIC_CONFIG
    • Constructor Detail

      • NumericConfig

        public NumericConfig​(int numDecDigits,
                             boolean incLeadingDigit,
                             boolean useNegParens,
                             boolean useNegCurrencyParens,
                             int numGroupDigits,
                             Locale locale)
    • Method Detail

      • getNumDecimalDigits

        public int getNumDecimalDigits()
      • includeLeadingDigit

        public boolean includeLeadingDigit()
      • useParensForNegatives

        public boolean useParensForNegatives()
      • useParensForCurrencyNegatives

        public boolean useParensForCurrencyNegatives()
      • getNumGroupingDigits

        public int getNumGroupingDigits()
      • format

        public String format​(float f)
        Returns:
        the given float formatted according to the current locale config
      • format

        public String format​(double d)
        Returns:
        the given double formatted according to the current locale config
      • format

        public String format​(BigDecimal bd)
        Returns:
        the given BigDecimal formatted according to the current locale config