summaryrefslogtreecommitdiff
path: root/src/balance.cc
diff options
context:
space:
mode:
Diffstat (limited to 'src/balance.cc')
-rw-r--r--src/balance.cc24
1 files changed, 23 insertions, 1 deletions
diff --git a/src/balance.cc b/src/balance.cc
index 1b343fb7..366eb7a7 100644
--- a/src/balance.cc
+++ b/src/balance.cc
@@ -30,10 +30,32 @@
*/
#include "balance.h"
-#include "unistring.h"
+#include "commodity.h"
+#include "unistring.h" // for justify()
namespace ledger {
+balance_t::balance_t(const double val)
+{
+ TRACE_CTOR(balance_t, "const double");
+ amounts.insert
+ (amounts_map::value_type(amount_t::current_pool->null_commodity, val));
+}
+
+balance_t::balance_t(const unsigned long val)
+{
+ TRACE_CTOR(balance_t, "const unsigned long");
+ amounts.insert
+ (amounts_map::value_type(amount_t::current_pool->null_commodity, val));
+}
+
+balance_t::balance_t(const long val)
+{
+ TRACE_CTOR(balance_t, "const long");
+ amounts.insert
+ (amounts_map::value_type(amount_t::current_pool->null_commodity, val));
+}
+
balance_t& balance_t::operator+=(const balance_t& bal)
{
foreach (const amounts_map::value_type& pair, bal.amounts)