|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.jinterop.dcom.core.JICurrency
public final class JICurrency
Definition 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 example :-
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
Constructor Summary | |
---|---|
JICurrency(int units,
int fractionalUnits)
|
|
JICurrency(java.lang.String value)
|
Method Summary | |
---|---|
int |
getFractionalUnits()
Returns the fractionalUnits value. |
int |
getUnits()
Returns the units value. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public JICurrency(java.lang.String value)
public JICurrency(int units, int fractionalUnits)
Method Detail |
---|
public int getUnits()
public int getFractionalUnits()
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |