Money.h++ uses currency exchange objects to convert money of one currency into money of another currency. These objects encapsulate the source and target currency mnemonics, the conversion factors and the exchange algorithm needed for a conversion. Three conversion methods are provided:
A triangular conversion method in which the source currency amount is converted to an intermediate currency amount, then the intermediate currency amount is converted to the target amount. This is the method required by members of the European Monetary Union (EMU), for converting among national currencies that are transitioning to the Euro. C++ class RWTriangularExchange implements this conversion method, as does Java class TriangularExchange.
A conversion method in which the source currency amount is multiplied by a conversion factor to obtain the target currency amount. C++ class RWMultiplicationExchange and Java class MultiplicationExchange implement this conversion method.
A conversion method in which the source currency amount is divided by a conversion factor to obtain the target currency amount. C++ class RWDivisionExchange and Java class DivisionExchange implement this conversion method.
In addition to currency exchange objects, Money.h++ provides currency exchange groups. A currency exchange group creates an exchange object when it is presented with a source currency, a target currency and an exchange rate table. The exchange objects associated with a particular exchange group have a common distinguishing characteristics. For example, RWEuroGroup provides exchange objects for of all the currencies that are scheduled to be replaced by the Euro. Similarly, RWMultiplicationGroup and RWDivisionGroup provide of currencies that implement the conversion by multiplication and conversion by division, respectively. Java versions of these classes include:
©Copyright 1999, Rogue Wave Software, Inc.
Contact Rogue Wave about documentation or support issues.