diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/value.cc | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/src/value.cc b/src/value.cc index 5a0c7e70..660c7663 100644 --- a/src/value.cc +++ b/src/value.cc @@ -967,7 +967,12 @@ bool value_t::operator<(const value_t& val) const case INTEGER: return as_amount() < val.as_long(); case AMOUNT: - return as_amount() < val.as_amount(); + try { + return as_amount() < val.as_amount(); + } + catch (const amount_error&) { + return compare_amount_commodities()(&as_amount(), &val.as_amount()); + } default: break; } |