Money
Money<T>
is a base class to be used for operations which include counting money. Provides necessary tools for working with money-like variables.
Its using implies creating your own money class that specifies base simple type to store money value in. The usage examples are provided below.
Basic usage
First of all, some application-specific money class should be defined. Overriding of basic math operators is needed here because basic class didn't know about long
type and thus about basic operations with it.
All other stuff such as comparison and equality is already defined in base class.
Money class allows to use currencies is also available:
All operations will be performed considering currency.
Last updated