From 479dd85da543b7af8e5f888ff2f2beaf6ff6923b Mon Sep 17 00:00:00 2001 From: John Wiegley Date: Sun, 15 Apr 2007 11:17:00 +0000 Subject: Miscellaneous changes --- amount.h | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) (limited to 'amount.h') 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; } -- cgit v1.2.3