summaryrefslogtreecommitdiff
path: root/src/textual.cc
diff options
context:
space:
mode:
authorJohn Wiegley <johnw@newartisans.com>2023-03-02 15:04:29 -0800
committerMartin Michlmayr <tbm@cyrius.com>2023-03-03 14:23:27 +0800
commit87b6a1e43fcf3d0f33e37ff811679486637f0809 (patch)
tree0b2bf81e4a99e208c0de1a0b93d89ec14eff21f2 /src/textual.cc
parent3555f20d03a056ea3d041f3ee57eb7fecec2bcb6 (diff)
downloadfork-ledger-87b6a1e43fcf3d0f33e37ff811679486637f0809.tar.gz
fork-ledger-87b6a1e43fcf3d0f33e37ff811679486637f0809.tar.bz2
fork-ledger-87b6a1e43fcf3d0f33e37ff811679486637f0809.zip
Do not perform commodity reduction when parsing a format directive
Diffstat (limited to 'src/textual.cc')
-rw-r--r--src/textual.cc8
1 files changed, 5 insertions, 3 deletions
diff --git a/src/textual.cc b/src/textual.cc
index 62007abb..5276c92b 100644
--- a/src/textual.cc
+++ b/src/textual.cc
@@ -1132,10 +1132,12 @@ void instance_t::commodity_format_directive(commodity_t& comm, string format)
// observational formatting.
trim(format);
amount_t amt;
- amt.parse(format);
+ amt.parse(format, PARSE_NO_REDUCE);
if (amt.commodity() != comm)
- throw_(parse_error, _f("commodity directive symbol %1% and format directive symbol %2% should be the same") %
- comm.symbol() % amt.commodity().symbol());
+ throw_(parse_error,
+ _f("commodity directive symbol %1% and format directive symbol %2% should be the same")
+ % comm.symbol()
+ % amt.commodity().symbol());
amt.commodity().add_flags(COMMODITY_STYLE_NO_MIGRATE);
VERIFY(amt.valid());
}