diff options
Diffstat (limited to 'src/value.cc')
-rw-r--r-- | src/value.cc | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/src/value.cc b/src/value.cc index b079c54b..be78327a 100644 --- a/src/value.cc +++ b/src/value.cc @@ -1395,6 +1395,26 @@ value_t value_t::round() const return NULL_VALUE; } +void value_t::in_place_round() +{ + switch (type()) { + case INTEGER: + break; + case AMOUNT: + as_amount_lval().in_place_round(); + break; + case BALANCE: + as_balance_lval().in_place_round(); + break; + case BALANCE_PAIR: + as_balance_pair_lval().in_place_round(); + break; + default: + throw_(value_error, "Cannot round " << label()); + break; + } +} + value_t value_t::unround() const { switch (type()) { |