From 033759c208cfae3d11851d6874fc83e7d1866c84 Mon Sep 17 00:00:00 2001 From: Kuang-che Wu Date: Thu, 10 Oct 2024 11:49:12 +0800 Subject: also follow precision from balance assignment Fixes #2129 --- src/textual.cc | 2 +- test/regress/1654.test | 10 ++++++++++ test/regress/640D3205.test | 2 +- 3 files changed, 12 insertions(+), 2 deletions(-) create mode 100644 test/regress/1654.test diff --git a/src/textual.cc b/src/textual.cc index 4105a42d..4ae64890 100644 --- a/src/textual.cc +++ b/src/textual.cc @@ -1658,7 +1658,7 @@ post_t * instance_t::parse_post(char * line, ptristream stream(p, static_cast(len - beg)); if (*p != '(') // indicates a value expression - post->assigned_amount->parse(stream, PARSE_NO_MIGRATE); + post->assigned_amount->parse(stream); else parse_amount_expr(stream, *context.scope, *post.get(), *post->assigned_amount, diff --git a/test/regress/1654.test b/test/regress/1654.test new file mode 100644 index 00000000..282f77be --- /dev/null +++ b/test/regress/1654.test @@ -0,0 +1,10 @@ +2018/01/01 foo + Account = 10 USD + Equity + +test balance + 10 USD Account + -10 USD Equity +-------------------- + 0 +end test diff --git a/test/regress/640D3205.test b/test/regress/640D3205.test index f43b850f..4f78f048 100644 --- a/test/regress/640D3205.test +++ b/test/regress/640D3205.test @@ -14,7 +14,7 @@ test print Income:Somewhere 2008/12/31 * Interest - Assets:Brokerage $200.00 = $1000.00 + Assets:Brokerage $200.00 = $1,000.00 Income:Somewhere end test -- cgit v1.2.3