The money pattern represents a monetary value. Issues include currency conversation, rounding, allocation, printing or displaying of a numerica value, and etc.
The money pattern generally involves creating a Money class with properties for the numeric amount and the type of currency. the numeric amount should be either an integer (record money in pennies) or a fixed decimal type, but never a floating point type.
There are times when you several kinds of numberic amount types. For example, when calculating direct labor costs for a product, you may want to use four decimal points, however, when calculating the final cost per unit, you will want to use a two decimal points. The conversion between these two decimal types should be contained in the Money class. Allow users the option to use the decimal type they need for a method.
An example of the allocation issue is when you include sales tax within the sale price. You need to allocate a portion of the sales price to the sales tax and to the net sales price. The resulting amount must equal the sales price.