From e3bcb8e87e4f89b7fc694c2c444f602aa9ee2bab Mon Sep 17 00:00:00 2001 From: John Wiegley Date: Mon, 1 Jan 2018 12:47:42 -0800 Subject: The "format" directive for commodities now disables "style observation" --- src/amount.cc | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'src/amount.cc') diff --git a/src/amount.cc b/src/amount.cc index 0244de66..f7b976a0 100644 --- a/src/amount.cc +++ b/src/amount.cc @@ -1090,6 +1090,8 @@ bool amount_t::parse(std::istream& in, const parse_flags_t& flags) bool no_more_commas = false; bool no_more_periods = false; + bool no_migrate_style + = commodity().has_flags(COMMODITY_STYLE_NO_MIGRATE); bool decimal_comma_style = (commodity_t::decimal_comma_by_default || commodity().has_flags(COMMODITY_STYLE_DECIMAL_COMMA)); @@ -1173,7 +1175,7 @@ bool amount_t::parse(std::istream& in, const parse_flags_t& flags) // is non-NULL. new_quantity->add_flags(BIGINT_KEEP_PREC); } - else if (commodity_) { + else if (commodity_ && ! no_migrate_style) { commodity().add_flags(comm_flags); if (new_quantity->prec > commodity().precision()) -- cgit v1.2.3