summaryrefslogtreecommitdiff
path: root/amount.h
diff options
context:
space:
mode:
authorJohn Wiegley <johnw@newartisans.com>2007-04-15 11:17:00 +0000
committerJohn Wiegley <johnw@newartisans.com>2008-04-13 03:35:32 -0400
commit479dd85da543b7af8e5f888ff2f2beaf6ff6923b (patch)
tree7a447b52ab366c1f5a9399f9365a45b0879305b4 /amount.h
parent0ef82600e5978495cccb4eed63b1de7094deab04 (diff)
downloadfork-ledger-479dd85da543b7af8e5f888ff2f2beaf6ff6923b.tar.gz
fork-ledger-479dd85da543b7af8e5f888ff2f2beaf6ff6923b.tar.bz2
fork-ledger-479dd85da543b7af8e5f888ff2f2beaf6ff6923b.zip
Miscellaneous changes
Diffstat (limited to 'amount.h')
-rw-r--r--amount.h9
1 files changed, 8 insertions, 1 deletions
diff --git a/amount.h b/amount.h
index cb900b48..93072d2c 100644
--- a/amount.h
+++ b/amount.h
@@ -95,7 +95,8 @@ class amount_t
return ! quantity && ! has_commodity();
}
- std::string quantity_string() const;
+ std::string to_string() const;
+ std::string quantity_string() const {}
// assignment operator
amount_t& operator=(const amount_t& amt);
@@ -306,6 +307,12 @@ class amount_t
void read_quantity(char *& data);
};
+inline std::string amount_t::to_string() const {
+ std::ostringstream bufstream;
+ print(bufstream);
+ return bufstream.str();
+}
+
inline amount_t abs(const amount_t& amt) {
return amt < 0 ? amt.negated() : amt;
}