diff options
-rw-r--r-- | src/value.cc | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/src/value.cc b/src/value.cc index 43524d3f..a1316568 100644 --- a/src/value.cc +++ b/src/value.cc @@ -857,12 +857,10 @@ bool value_t::is_less_than(const value_t& val) const case INTEGER: return as_amount() < val.as_long(); case AMOUNT: - try { + if (as_amount().commodity() == val.as_amount().commodity()) return as_amount() < val.as_amount(); - } - catch (const amount_error&) { + else return commodity_t::compare_by_commodity()(&as_amount(), &val.as_amount()); - } default: break; } |