diff options
author | John Wiegley <johnw@newartisans.com> | 2009-02-27 02:15:27 -0400 |
---|---|---|
committer | John Wiegley <johnw@newartisans.com> | 2009-02-27 02:15:27 -0400 |
commit | fbb0d2583173073e11976c7cd7e570d4829f0621 (patch) | |
tree | 7c83465d30bd45f89f82757d5f3041a9e3903f1f /src/value.h | |
parent | ecb1ca71c12f7772d345f19b6df821da123d3b57 (diff) | |
download | fork-ledger-fbb0d2583173073e11976c7cd7e570d4829f0621.tar.gz fork-ledger-fbb0d2583173073e11976c7cd7e570d4829f0621.tar.bz2 fork-ledger-fbb0d2583173073e11976c7cd7e570d4829f0621.zip |
Gave round/unround/truncate all in_place_ variants
Diffstat (limited to 'src/value.h')
-rw-r--r-- | src/value.h | 23 |
1 files changed, 20 insertions, 3 deletions
diff --git a/src/value.h b/src/value.h index 4d019450..35d7f6a8 100644 --- a/src/value.h +++ b/src/value.h @@ -409,9 +409,26 @@ public: value_t abs() const; - value_t rounded() const; - value_t truncated() const; - value_t unrounded() const; + value_t rounded() const { + value_t temp(*this); + temp.in_place_round(); + return temp; + } + void in_place_round(); + + value_t truncated() const { + value_t temp(*this); + temp.in_place_truncate(); + return temp; + } + void in_place_truncate(); + + value_t unrounded() const { + value_t temp(*this); + temp.in_place_unround(); + return temp; + } + void in_place_unround(); value_t reduced() const { value_t temp(*this); |