Allow sequences to be rounded and unrounded

The result is that every member of the sequence has the given operation
applied.
This commit is contained in:
John Wiegley 2009-02-25 23:42:31 -04:00
parent 55a6d588ff
commit 247cf58bfa

View file

@ -1282,6 +1282,12 @@ value_t value_t::rounded() const
return as_amount().rounded();
case BALANCE:
return as_balance().rounded();
case SEQUENCE: {
value_t temp;
foreach (const value_t& value, as_sequence())
temp.push_back(value.rounded());
return temp;
}
default:
break;
}
@ -1299,6 +1305,12 @@ value_t value_t::unrounded() const
return as_amount().unrounded();
case BALANCE:
return as_balance().unrounded();
case SEQUENCE: {
value_t temp;
foreach (const value_t& value, as_sequence())
temp.push_back(value.unrounded());
return temp;
}
default:
break;
}