summaryrefslogtreecommitdiff
path: root/amount.h
diff options
context:
space:
mode:
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;
}