Class representing a numbered amount with a fixed decimal point. More...
#include <currency.h>


Public Member Functions | |
| currency (void) | |
| currency (const currency &) | |
| currency (currency *) | |
| currency (long long) | |
| currency (const class value &) | |
| currency (class value *) | |
| currency (double) | |
| ~currency (void) | |
| operator long long (void) | |
| const char * | str (void) const |
| const char * | cval (void) const |
| long long | value (void) const |
| virtual void | init (bool first) |
| currency & | operator= (long long) |
| currency & | operator= (const currency &) |
| currency & | operator= (currency *) |
| currency & | operator= (const class value &) |
| currency & | operator= (class value *) |
| currency & | operator= (double) |
| long long | operator+ (long long) const |
| long long | operator+ (const currency &) const |
| long long | operator- (long long) const |
| long long | operator- (const currency &) const |
| currency & | operator+= (long long) |
| currency & | operator+= (const currency &) |
| currency & | operator-= (long long) |
| currency & | operator-= (const currency &) |
| currency & | operator*= (int) |
| currency & | operator*= (double) |
| currency & | operator*= (const currency &) |
| currency & | operator*= (long long) |
| currency & | operator/= (int) |
| currency & | operator/= (double) |
| currency & | operator/= (const currency &) |
| currency & | operator/= (long long) |
| long long | operator* (int) const |
| long long | operator* (double) const |
| long long | operator* (const currency &) const |
| long long | operator* (long long) const |
| long long | operator/ (int) const |
| long long | operator/ (double) const |
| long long | operator/ (const currency &) const |
| long long | operator/ (long long) const |
| bool | operator== (const currency &) const |
| bool | operator== (long long) const |
| bool | operator!= (const currency &) const |
| bool | operator!= (long long) const |
| bool | operator< (const currency &) const |
| bool | operator< (long long) const |
| bool | operator<= (const currency &) const |
| bool | operator<= (long long) const |
| bool | operator> (const currency &) const |
| bool | operator> (long long) const |
| bool | operator>= (const currency &) const |
| bool | operator>= (long long) const |
Protected Attributes | |
| long long | val |
| char | presentation [24] |
Class representing a numbered amount with a fixed decimal point.
Internally, the amount is stored with three decimal places of accuracy and uses this for calculations. When converting the currency for display, however, it is rounded to two decimal places.
| currency::currency | ( | long long | orig | ) |
| const char * currency::str | ( | void | ) | const |
Convert to string.
Prints with two digits behind the decimal point, rounded up from .005.
References presentation, and val.
Referenced by cval().
1.6.1