|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.zkoss.math.BigDecimals
public class BigDecimals
Utilities and constants of big decimals.
Field Summary | |
---|---|
static int |
FINE_NUMBER_PRECISION
Represents our fine number precision. |
static int |
FINE_NUMBER_SCALE
Represents our fine number scale. |
static java.math.BigDecimal |
MINUS_ONE
Represents -1 in big decimal. |
static int |
NUMBER_PRECISION
Represents our number precision. |
static int |
NUMBER_SCALE
Represents our number scale. |
static java.math.BigDecimal |
ONE
Represents 1 in big decimal. |
static java.math.BigDecimal |
ZERO
Represents 0 in big decimal. |
Constructor Summary | |
---|---|
BigDecimals()
|
Method Summary | |
---|---|
static java.math.BigDecimal |
toBigDecimal(byte v)
Converts a byte to a big decimal with a scale without. |
static java.math.BigDecimal |
toBigDecimal(java.lang.Byte v)
Converts a byte to a big decimal with a scale without. |
static java.math.BigDecimal |
toBigDecimal(double v,
int scale)
Converts a double to a big decimal with a scale. |
static java.math.BigDecimal |
toBigDecimal(double v,
int scale,
int roundingMode)
Converts a double to a big decimal with a scale. |
static java.math.BigDecimal |
toBigDecimal(int v)
Converts an integer to a big decimal with a scale without. |
static java.math.BigDecimal |
toBigDecimal(java.lang.Integer v)
Converts an integer to a big decimal with a scale without. |
static java.math.BigDecimal |
toBigDecimal(int v,
int scale)
Converts an integer to a big decimal with a scale. |
static java.math.BigDecimal |
toBigDecimal(long v)
Converts a long to a big decimal with a scale without. |
static java.math.BigDecimal |
toBigDecimal(java.lang.Long v)
Converts a long to a big decimal with a scale without. |
static java.math.BigDecimal |
toBigDecimal(long v,
int scale)
Converts an integer to a big decimal with a scale. |
static java.math.BigDecimal |
toBigDecimal(short v)
Converts a short to a big decimal with a scale without. |
static java.math.BigDecimal |
toBigDecimal(java.lang.Short v)
Converts a short to a big decimal with a scale without. |
static java.lang.String |
toLocaleString(java.math.BigDecimal bd,
java.util.Locale locale)
Return a string representation of this BigDecimal without an exponent field, which respects the given locale. |
static java.lang.String |
toPlainString(java.math.BigDecimal bd)
Deprecated. As of release 6.0.0, use BigDecimal.toPlainString() directly (since we don't support JDK 1.4) anymore. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final java.math.BigDecimal ZERO
ONE
,
MINUS_ONE
public static final java.math.BigDecimal ONE
ZERO
,
MINUS_ONE
public static final java.math.BigDecimal MINUS_ONE
ZERO
,
ONE
public static final int NUMBER_PRECISION
public static final int NUMBER_SCALE
public static final int FINE_NUMBER_PRECISION
public static final int FINE_NUMBER_SCALE
Constructor Detail |
---|
public BigDecimals()
Method Detail |
---|
public static final java.math.BigDecimal toBigDecimal(double v, int scale, int roundingMode)
It is strongly deprecated to use new Dicimal(double) since the scale is unpredictable and usually surprising. Example, BigDecimal(.1) will becomes .1000000000000000055511151231257827021181583404541015625. On the other hand, BigDecimal("0.1") will be 0.1 correctly.
scale
- the BigDecimal's scaleroundingMode
- the rounding modepublic static final java.math.BigDecimal toBigDecimal(double v, int scale)
BigDecimal.ROUND_HALF_UP
.
public static final java.math.BigDecimal toBigDecimal(int v, int scale)
public static final java.math.BigDecimal toBigDecimal(long v, int scale)
public static final java.math.BigDecimal toBigDecimal(int v)
public static final java.math.BigDecimal toBigDecimal(long v)
public static final java.math.BigDecimal toBigDecimal(short v)
public static final java.math.BigDecimal toBigDecimal(byte v)
public static final java.math.BigDecimal toBigDecimal(java.lang.Integer v)
public static final java.math.BigDecimal toBigDecimal(java.lang.Long v)
public static final java.math.BigDecimal toBigDecimal(java.lang.Short v)
public static final java.math.BigDecimal toBigDecimal(java.lang.Byte v)
public static final java.lang.String toPlainString(java.math.BigDecimal bd)
public static final java.lang.String toLocaleString(java.math.BigDecimal bd, java.util.Locale locale)
locale
- if null, the current user locale is used.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |