diff options
author | John Wiegley <johnw@newartisans.com> | 2009-10-27 08:03:16 -0400 |
---|---|---|
committer | John Wiegley <johnw@newartisans.com> | 2009-10-27 08:30:59 -0400 |
commit | a8768587c8e6850e23ecbbfe4a108515b8ade892 (patch) | |
tree | 2f9c614b3a52c22af3ed5695b8d6e06a8410d19b /src | |
parent | 4bdc0a663c6b746e41aeb0685d336516e79c0834 (diff) | |
download | fork-ledger-a8768587c8e6850e23ecbbfe4a108515b8ade892.tar.gz fork-ledger-a8768587c8e6850e23ecbbfe4a108515b8ade892.tar.bz2 fork-ledger-a8768587c8e6850e23ecbbfe4a108515b8ade892.zip |
Allow any amount to be multipled by another
The result carries the commodity of the first amount, or the second if
the first had no commodity.
Diffstat (limited to 'src')
-rw-r--r-- | src/value.cc | 9 |
1 files changed, 2 insertions, 7 deletions
diff --git a/src/value.cc b/src/value.cc index c3a3a05b..17987bd7 100644 --- a/src/value.cc +++ b/src/value.cc @@ -585,13 +585,8 @@ value_t& value_t::operator*=(const value_t& val) as_amount_lval() *= val.as_long(); return *this; case AMOUNT: - if (as_amount().commodity() == val.as_amount().commodity() || - ! as_amount().has_commodity() || - ! val.as_amount().has_commodity()) { - as_amount_lval() *= val.as_amount(); - return *this; - } - break; + as_amount_lval() *= val.as_amount(); + return *this; default: break; } |