diff options
author | Craig Earls <enderw88@gmail.com> | 2013-01-30 15:35:31 -0700 |
---|---|---|
committer | Craig Earls <enderw88@gmail.com> | 2013-01-30 15:35:31 -0700 |
commit | 0df13661686dfec66aa0d5a8dd88920e1e104fbc (patch) | |
tree | cbf9270fc8fe85d0ae67c1c1f3ab8d42296c232b /src/value.h | |
parent | 383c341d885e1a69fc63aca2ae7db4a2ff5ff1a8 (diff) | |
download | fork-ledger-0df13661686dfec66aa0d5a8dd88920e1e104fbc.tar.gz fork-ledger-0df13661686dfec66aa0d5a8dd88920e1e104fbc.tar.bz2 fork-ledger-0df13661686dfec66aa0d5a8dd88920e1e104fbc.zip |
Bug 634 Added roundto function, optimized floor and ceiling
Fixes Bug634 by adding roundto(amount, places).
Diffstat (limited to 'src/value.h')
-rw-r--r-- | src/value.h | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/src/value.h b/src/value.h index 249f3d7f..49d64ab6 100644 --- a/src/value.h +++ b/src/value.h @@ -443,6 +443,13 @@ public: } void in_place_round(); + value_t roundto(int places) const { + value_t temp(*this); + temp.in_place_roundto(places); + return temp; + } + void in_place_roundto(int places); + value_t truncated() const { value_t temp(*this); temp.in_place_truncate(); |