Class NumericConfig
- java.lang.Object
-
- com.healthmarketscience.jackcess.expr.NumericConfig
-
public class NumericConfig extends Object
A NumericConfig encapsulates number formatting options for expression evaluation. The defaultUS_NUMERIC_CONFIGinstance 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
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classNumericConfig.Type
-
Field Summary
Fields Modifier and Type Field Description static NumericConfigUS_NUMERIC_CONFIG
-
Constructor Summary
Constructors Constructor Description NumericConfig(int numDecDigits, boolean incLeadingDigit, boolean useNegParens, boolean useNegCurrencyParens, int numGroupDigits, Locale locale)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Stringformat(double d)Stringformat(float f)Stringformat(BigDecimal bd)DecimalFormatSymbolsgetDecimalFormatSymbols()StringgetNumberFormat(NumericConfig.Type type)intgetNumDecimalDigits()intgetNumGroupingDigits()booleanincludeLeadingDigit()booleanuseParensForCurrencyNegatives()booleanuseParensForNegatives()
-
-
-
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()
-
getNumberFormat
public String getNumberFormat(NumericConfig.Type type)
-
getDecimalFormatSymbols
public DecimalFormatSymbols getDecimalFormatSymbols()
-
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
-
-