diff options
Diffstat (limited to 'src/amount.cc')
-rw-r--r-- | src/amount.cc | 22 |
1 files changed, 8 insertions, 14 deletions
diff --git a/src/amount.cc b/src/amount.cc index 885eaf43..d7cdbacb 100644 --- a/src/amount.cc +++ b/src/amount.cc @@ -464,32 +464,26 @@ amount_t amount_t::inverted() const return t; } -amount_t amount_t::rounded() const +void amount_t::in_place_round() { if (! quantity) throw_(amount_error, _("Cannot set rounding for an uninitialized amount")); else if (! keep_precision()) - return *this; - - amount_t t(*this); - t._dup(); - t.set_keep_precision(false); + return; - return t; + _dup(); + set_keep_precision(false); } -amount_t amount_t::unrounded() const +void amount_t::in_place_unround() { if (! quantity) throw_(amount_error, _("Cannot unround an uninitialized amount")); else if (keep_precision()) - return *this; - - amount_t t(*this); - t._dup(); - t.set_keep_precision(true); + return; - return t; + _dup(); + set_keep_precision(true); } void amount_t::in_place_reduce() |