org.jinterop.dcom.core
Class JICurrency
java.lang.Object
org.jinterop.dcom.core.JICurrency
public final class JICurrency
- extends java.lang.Object
From MSDN: encapsulates the CURRENCY data type used in Automation. CURRENCY is implemented
as an 8-byte, two's-complement integer value scaled by 10,000. This gives a fixed-point number
with 15 digits to the left of the decimal point and 4 digits to the right. The CURRENCY data type
is extremely useful for calculations involving money, or for any fixed-point calculation where accuracy
is important. It is one of the possible types for the VARIANT data type of Automation.
for e.g.
If the absolute value of the fractional part is greater than 10,000, the appropriate adjustment
is made to the units, as shown in the third of the following examples.
Note that the units and fractional part are specified by signed long values. The fourth of the following
examples shows what happens when the parameters have different signs.
COleCurrency curA; // value: 0.0000
curA.SetCurrency(4, 500); // value: 4.0500
curA.SetCurrency(2, 11000); // value: 3.1000
curA.SetCurrency(2, -50); // value: 1.9950
- Since:
- 1.0
Constructor Summary |
JICurrency(int units,
int fractionalUnits)
|
Method Summary |
int |
getFractionalUnits()
Returns the encapsulated fractionalUnits value. |
int |
getUnits()
Returns the encapsulated units value. |
Methods inherited from class java.lang.Object |
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
JICurrency
public JICurrency(int units,
int fractionalUnits)
getUnits
public int getUnits()
- Returns the encapsulated units value.
- Returns:
getFractionalUnits
public int getFractionalUnits()
- Returns the encapsulated fractionalUnits value.
- Returns: