diff options
author | John Wiegley <johnw@newartisans.com> | 2007-04-15 11:17:00 +0000 |
---|---|---|
committer | John Wiegley <johnw@newartisans.com> | 2008-04-13 03:35:32 -0400 |
commit | 479dd85da543b7af8e5f888ff2f2beaf6ff6923b (patch) | |
tree | 7a447b52ab366c1f5a9399f9365a45b0879305b4 /amount.h | |
parent | 0ef82600e5978495cccb4eed63b1de7094deab04 (diff) | |
download | fork-ledger-479dd85da543b7af8e5f888ff2f2beaf6ff6923b.tar.gz fork-ledger-479dd85da543b7af8e5f888ff2f2beaf6ff6923b.tar.bz2 fork-ledger-479dd85da543b7af8e5f888ff2f2beaf6ff6923b.zip |
Miscellaneous changes
Diffstat (limited to 'amount.h')
-rw-r--r-- | amount.h | 9 |
1 files changed, 8 insertions, 1 deletions
@@ -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; } |