Rogue Wave banner
Previous fileTop of DocumentContentsIndexNext file

2.2 Money Class

Money objects are available through classes RWMoney in the Money.h++ C++ library, and Money in the Java library. A money object attaches a currency mnemonic to an amount by encapsulating a decimal value and referencing a currency. In C++, the value is a decimal type specified as a template parameter. In Java, the value is either a double or a BigDecimal, from the JDK java.math package.

The C++ version of RWMoney uses global operators for arithmetic operations between money objects of the same currency, and the Java version of the class uses methods. If the currencies for two RWMoney operands in such a calculation are different, the operator (or method, in Java) throws an exception. To perform calculations with monies of different currencies, you must use C++ class RWMoneyCalculator or Java class MoneyCalculator.

See Chapter 4, "Money and Calculations," and the Class Reference for more information about using class RWMoney.


Previous fileTop of DocumentContentsIndexNext file

©Copyright 1999, Rogue Wave Software, Inc.
Contact Rogue Wave about documentation or support issues.