#include <Money.h>
Public Member Functions | |
Money (int dollars=0, int cents=0) | |
int | getDollars () const |
int | getCents () const |
bool | isNegative () const |
Money | operator+ (const Money &other) const |
void | operator+= (const Money &other) |
Money | operator- (const Money &other) const |
void | operator-= (const Money &other) |
Money | operator- () const |
bool | operator< (const Money &other) const |
bool | operator<= (const Money &other) const |
bool | operator> (const Money &other) const |
bool | operator>= (const Money &other) const |
bool | operator== (const Money &other) const |
bool | operator!= (const Money &other) const |
Money | operator * (double factor) const |
|
Construct a new money instance. Automatically normalizes so that cents is between -99 and 99 and so that signs of the dollar and cents values do not disagree.
|
|
Return the amount of cents. If overall value is negative, the returned amount will be appropriately negated.
|
|
Return the amount of dollars. If overall value is negative, the returned amount will be appropriately negated.
|
|
Checks if current value is negative.
|
|
Multiply monetary amount by a constant. Rounds to nearest cent.
|
|
Compares two monetary amounts
|
|
Binary addition of monetary values.
|
|
Mutating form of addition for monetary values.
|
|
Unary negation of monetary value.
|
|
Binary subtraction of monetary values.
|
|
Mutating form of subtraction for monetary values.
|
|
Compares two monetary amounts
|
|
Compares two monetary amounts
|
|
Compares two monetary amounts
|
|
Compares two monetary amounts
|
|
Compares two monetary amounts
|