org.jinterop.dcom.core
Class JICurrency

java.lang.Object
  extended by org.jinterop.dcom.core.JICurrency

public final class JICurrency
extends java.lang.Object

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

Since:
1.0

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

JICurrency

public JICurrency(java.lang.String value)

JICurrency

public JICurrency(int units,
                  int fractionalUnits)
Method Detail

getUnits

public int getUnits()
Returns the units value.

Returns:

getFractionalUnits

public int getFractionalUnits()
Returns the fractionalUnits value.

Returns: