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.
This commit is contained in:
parent
4bdc0a663c
commit
a8768587c8
1 changed files with 2 additions and 7 deletions
|
|
@ -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;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue