diff options
-rw-r--r-- | src/value.cc | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/src/value.cc b/src/value.cc index cd4c4aa1..23806d24 100644 --- a/src/value.cc +++ b/src/value.cc @@ -658,7 +658,18 @@ value_t& value_t::operator/=(const value_t& val) return *this; case BALANCE: if (val.as_balance().single_amount()) { - as_amount_lval() /= val.simplified().as_amount(); + value_t simpler(val.simplified()); + switch (simpler.type()) { + case INTEGER: + as_amount_lval() /= simpler.as_long(); + break; + case AMOUNT: + as_amount_lval() /= simpler.as_amount(); + break; + default: + assert(0); + break; + } return *this; } break; |