diff options
author | John Wiegley <johnw@newartisans.com> | 2009-02-27 03:28:14 -0400 |
---|---|---|
committer | John Wiegley <johnw@newartisans.com> | 2009-02-27 03:45:32 -0400 |
commit | f1795e628b0027aed2dc344c757167887c337bc1 (patch) | |
tree | 4fea3644081c427daf247f34327510834ce28d5e /src/post.cc | |
parent | 501949a364d3a26418bd59957be4015207312191 (diff) | |
download | fork-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.cc | 12 |
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; |