summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorJohn Wiegley <johnw@newartisans.com>2009-10-27 08:03:16 -0400
committerJohn Wiegley <johnw@newartisans.com>2009-10-27 08:30:59 -0400
commita8768587c8e6850e23ecbbfe4a108515b8ade892 (patch)
tree2f9c614b3a52c22af3ed5695b8d6e06a8410d19b /src
parent4bdc0a663c6b746e41aeb0685d336516e79c0834 (diff)
downloadfork-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.cc9
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;
}