/** * Adds a BMoney to this value and returns a new object. * This object remains unchanged. * * @param val the money value to add * @return the sum of this and given value */ public BMoney add(BMoney val) { return new BMoney(unscaledValue().add(alignScale(val).unscaledValue()), scale()); }
/** * Subtracts a BMoney from this value and returns a new object. * This object remains unchanged. * * @param val the money value to subtract * @return this minus the given value */ public BMoney subtract(BMoney val) { return new BMoney(unscaledValue().subtract(alignScale(val).unscaledValue()), scale()); }