public class DefaultRoundingStrategy extends java.lang.Object implements RoundingStrategy
| Constructor and Description |
|---|
DefaultRoundingStrategy() |
| Modifier and Type | Method and Description |
|---|---|
protected Money |
createMoney(java.math.BigDecimal amount,
Currency curr) |
Money |
divide(Money price,
java.math.BigDecimal divisor)
Divide price by factor
|
Money |
getPercentValue(Money price,
Percentage percent)
Returns for the given
Percentage amount the calculated amount in Money. |
Money |
multiply(Money price,
java.math.BigDecimal multiplicant)
Multiply the given money by given factor.
|
Money |
roundToMoney(java.math.BigDecimal amount,
Currency currency)
Creates a
Money object based on the given BigDecimal amount. |
public Money divide(Money price, java.math.BigDecimal divisor)
RoundingStrategydivide in interface RoundingStrategyprice - to divide fordivisor - to divide bypublic Money multiply(Money price, java.math.BigDecimal multiplicant)
RoundingStrategymultiply in interface RoundingStrategyprice - to multiple formultiplicant - to multiple bypublic Money getPercentValue(Money price, Percentage percent)
RoundingStrategyPercentage amount the calculated amount in Money. E.g. 25% of 10.01Euro
result in 2.50eurogetPercentValue in interface RoundingStrategyprice - the pricepercent - the percentage of the price to take.public Money roundToMoney(java.math.BigDecimal amount, Currency currency)
RoundingStrategyMoney object based on the given BigDecimal amount. Based on the implementation the amount is
round up/down to fit into the money.roundToMoney in interface RoundingStrategyamount - the amount to be convertedcurrency - based on the currency digits the amount is round up/downCopyright © 2018 SAP SE. All Rights Reserved.