summaryrefslogtreecommitdiff
path: root/src/textual.cc
diff options
context:
space:
mode:
authorJohn Wiegley <johnw@newartisans.com>2009-12-07 21:23:50 -0500
committerJohn Wiegley <johnw@newartisans.com>2009-12-07 21:23:50 -0500
commitf1a2a5a18d5e7104ad308b2f56a9188f441bb7f2 (patch)
treeeeef84ba9b48e11296793c64a1ce20436cfd4316 /src/textual.cc
parent6d0ab845eaec51946190c847f1ad08f910e5a003 (diff)
downloadledger-f1a2a5a18d5e7104ad308b2f56a9188f441bb7f2.tar.gz
ledger-f1a2a5a18d5e7104ad308b2f56a9188f441bb7f2.tar.bz2
ledger-f1a2a5a18d5e7104ad308b2f56a9188f441bb7f2.zip
Cost of a post with neg. amount should be negative
Diffstat (limited to 'src/textual.cc')
-rw-r--r--src/textual.cc3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/textual.cc b/src/textual.cc
index c5a6d896..cbeb6358 100644
--- a/src/textual.cc
+++ b/src/textual.cc
@@ -1050,6 +1050,9 @@ post_t * instance_t::parse_post(char * line,
*post->cost *= post->amount;
post->cost->set_commodity(cost_commodity);
}
+ else if (post->amount.sign() < 0) {
+ post->cost->in_place_negate();
+ }
DEBUG("textual.parse", "line " << linenum << ": "
<< "Total cost is " << *post->cost);