public class DMoney extends BMoney
ONE, ROUND_CEILING, ROUND_DOWN, ROUND_FLOOR, ROUND_HALF_DOWN, ROUND_HALF_EVEN, ROUND_HALF_UP, ROUND_UNNECESSARY, ROUND_UP, TEN, ZERO| Constructor and Description |
|---|
DMoney()
Creates a zero DMoney with a scale ccording to
the currency of the current locale.
|
DMoney(BigDecimal val)
Creates a DMoney from a BigDecimal (userful for SQL)
|
DMoney(BigInteger intVal,
int scale)
Creates a DMoney value from a BigInteger.
The scale sets the comma within the given integer. |
DMoney(BMoney val,
int scale)
Creates a DMoney from a BMoney (useful to rescale)
|
DMoney(double val,
int scale)
Creates a DMoney value.
|
DMoney(int scale)
Creates a zero DMoney value.
|
DMoney(String val,
int scale)
Creates a DMoney value.
|
| Modifier and Type | Method and Description |
|---|---|
DMoney |
absolute()
Gets the absolute value.
|
DMoney |
add(BMoney val)
Adds a BMoney to this value and returns a new object.
|
DMoney |
divide(double val)
Divides a BMoney by double and returns a new object.
|
DMoney |
invert()
Inverts this money value.
|
DMoney |
multiply(double val)
Multiplies this BMoney by a double and returns a new object.
|
DMoney |
smallestPositive()
Returns the smalles positive value.
Ex.: if scale is 2 --> 0.01 will be returned. |
DMoney |
subtract(BMoney val)
Subtracts a BMoney from this value and returns a new object.
|
alignScale, clone, divide, isNegative, isPositive, isZero, toWordsabs, abs, add, add, byteValueExact, compareTo, divide, divide, divide, divide, divide, divide, divideAndRemainder, divideAndRemainder, divideToIntegralValue, divideToIntegralValue, doubleValue, equals, floatValue, hashCode, intValue, intValueExact, longValue, longValueExact, max, min, movePointLeft, movePointRight, multiply, multiply, negate, negate, plus, plus, pow, pow, precision, remainder, remainder, round, scale, scaleByPowerOfTen, setScale, setScale, setScale, shortValueExact, signum, stripTrailingZeros, subtract, subtract, toBigInteger, toBigIntegerExact, toEngineeringString, toPlainString, toString, ulp, unscaledValue, valueOf, valueOf, valueOfbyteValue, shortValuepublic DMoney(double val,
int scale)
val - double-representation of the numberscale - the digits after comma the value should be rounded topublic DMoney(String val, int scale)
val - the stringscale - the digits after comma the value should be rounded topublic DMoney(int scale)
scale - the digits after commapublic DMoney(BigInteger intVal, int scale)
intVal - the big integerscale - the digits after commapublic DMoney(BMoney val, int scale)
val - the BMoney or DMoney valuescale - the digits after comma the value should be rounded topublic DMoney(BigDecimal val)
val - the decimal valuepublic DMoney()
public DMoney add(BMoney val)
BMoneypublic DMoney subtract(BMoney val)
BMoneypublic DMoney multiply(double val)
BMoneypublic DMoney divide(double val)
BMoneypublic DMoney smallestPositive()
BMoneysmallestPositive in class BMoneyTentackle - a domain driven enterprise framework