summaryrefslogtreecommitdiff
path: root/valexpr.cc
diff options
context:
space:
mode:
Diffstat (limited to 'valexpr.cc')
-rw-r--r--valexpr.cc7
1 files changed, 5 insertions, 2 deletions
diff --git a/valexpr.cc b/valexpr.cc
index 16f43a15..509c6fa1 100644
--- a/valexpr.cc
+++ b/valexpr.cc
@@ -56,8 +56,11 @@ bool compute_amount(ptr_op_t expr, amount_t& amt,
value_t result;
try {
expr->compute(result, xact ? details_t(*xact) : details_t(), context);
- result.cast(value_t::AMOUNT);
- amt = result.as_amount_lval();
+
+ // Most of the time when computing the amount of a transaction this cast
+ // will do nothing at all.
+ result.in_place_cast(value_t::AMOUNT);
+ amt = result.as_amount();
}
catch (error * err) {
if (err->context.empty() ||