summaryrefslogtreecommitdiff
path: root/src/post.cc
diff options
context:
space:
mode:
authorJohn Wiegley <johnw@newartisans.com>2009-02-27 03:28:14 -0400
committerJohn Wiegley <johnw@newartisans.com>2009-02-27 03:45:32 -0400
commitf1795e628b0027aed2dc344c757167887c337bc1 (patch)
tree4fea3644081c427daf247f34327510834ce28d5e /src/post.cc
parent501949a364d3a26418bd59957be4015207312191 (diff)
downloadfork-ledger-f1795e628b0027aed2dc344c757167887c337bc1.tar.gz
fork-ledger-f1795e628b0027aed2dc344c757167887c337bc1.tar.bz2
fork-ledger-f1795e628b0027aed2dc344c757167887c337bc1.zip
Fixed bugs relating to sign and rounding of costs
Diffstat (limited to 'src/post.cc')
-rw-r--r--src/post.cc12
1 files changed, 9 insertions, 3 deletions
diff --git a/src/post.cc b/src/post.cc
index 5c0d98e7..d99d1e97 100644
--- a/src/post.cc
+++ b/src/post.cc
@@ -319,9 +319,15 @@ bool post_t::valid() const
return false;
}
- if (cost && ! cost->valid()) {
- DEBUG("ledger.validate", "post_t: cost && ! cost->valid()");
- return false;
+ if (cost) {
+ if (! cost->valid()) {
+ DEBUG("ledger.validate", "post_t: cost && ! cost->valid()");
+ return false;
+ }
+ if (! cost->keep_precision()) {
+ DEBUG("ledger.validate", "post_t: ! cost->keep_precision()");
+ return false;
+ }
}
return true;