diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/textual.cc | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/src/textual.cc b/src/textual.cc index f2996a03..3cf3c13c 100644 --- a/src/textual.cc +++ b/src/textual.cc @@ -969,8 +969,14 @@ post_t * instance_t::parse_post(char * line, post->cost->in_place_unround(); - if (per_unit) + if (per_unit) { + // For the sole case where the cost might be uncommoditized, + // guarantee that the commodity of the cost after multiplication + // is the same as it was before. + commodity_t& cost_commodity(post->cost->commodity()); *post->cost *= post->amount; + post->cost->set_commodity(cost_commodity); + } DEBUG("textual.parse", "line " << linenum << ": " << "Total cost is " << *post->cost); |