diff --git a/src/models/money.cpp b/src/models/money.cpp index 2ae2cf2..6d84ed7 100644 --- a/src/models/money.cpp +++ b/src/models/money.cpp @@ -32,9 +32,9 @@ bool operator<(const Money &lhs, const Money &rhs) { std::ostream &operator<<(std::ostream &os, const Money &money) { os << "$" << money.getDollars() << "."; - if (money.getCents() < 10) { + if (std::abs(money.getCents()) < 10) { os << "0"; } - os << money.getCents(); + os << std::abs(money.getCents()); return os; }