If a posting has an integer amount, convert it
This commit is contained in:
parent
e2c30cf6e4
commit
c305db937c
1 changed files with 7 additions and 3 deletions
|
|
@ -157,10 +157,14 @@ namespace {
|
|||
bind_scope_t bound_scope(session_scope, *post);
|
||||
|
||||
value_t result(expr.calc(bound_scope));
|
||||
if (! result.is_amount())
|
||||
throw_(parse_error, _("Postings may only specify simple amounts"));
|
||||
if (result.is_long()) {
|
||||
amount = result.to_amount();
|
||||
} else {
|
||||
if (! result.is_amount())
|
||||
throw_(parse_error, _("Postings may only specify simple amounts"));
|
||||
|
||||
amount = result.as_amount();
|
||||
amount = result.as_amount();
|
||||
}
|
||||
DEBUG("textual.parse", "The posting amount is " << amount);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue