diff options
author | Craig Earls <enderw88@gmail.com> | 2013-01-30 15:51:23 -0700 |
---|---|---|
committer | Craig Earls <enderw88@gmail.com> | 2013-01-30 15:51:23 -0700 |
commit | aeac4fe252954c21be0b6d2bac67ee74be77bf86 (patch) | |
tree | b362915d8bf22d8192cd052d4efdaeb76e235649 /src/amount.h | |
parent | b334be6d382d3bef45fb4ad46e0f52fd6cb9e0a4 (diff) | |
parent | 0df13661686dfec66aa0d5a8dd88920e1e104fbc (diff) | |
download | fork-ledger-aeac4fe252954c21be0b6d2bac67ee74be77bf86.tar.gz fork-ledger-aeac4fe252954c21be0b6d2bac67ee74be77bf86.tar.bz2 fork-ledger-aeac4fe252954c21be0b6d2bac67ee74be77bf86.zip |
Merge branch 'Bug634-floor-ceil-round' into kitchen-sink
Diffstat (limited to 'src/amount.h')
-rw-r--r-- | src/amount.h | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/src/amount.h b/src/amount.h index 1b7d2101..5fc2ad2e 100644 --- a/src/amount.h +++ b/src/amount.h @@ -346,6 +346,13 @@ public: } void in_place_round(); + amount_t roundto(int places) const { + amount_t temp(*this); + temp.in_place_round(); + return temp; + } + void in_place_roundto(int places); + /** Yields an amount which has lost all of its extra precision, beyond what the display precision of the commodity would have printed. */ amount_t truncated() const { |