org.broadleafcommerce.common.currency.util
Class BroadleafCurrencyUtils
java.lang.Object
org.broadleafcommerce.common.currency.util.BroadleafCurrencyUtils
public class BroadleafCurrencyUtils
- extends Object
Utility methods for common currency operations
- Author:
- Phillip Verheyden
- See Also:
BroadleafCurrency}
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
ROUND_FLOOR_MATH_CONTEXT
public static final MathContext ROUND_FLOOR_MATH_CONTEXT
BroadleafCurrencyUtils
public BroadleafCurrencyUtils()
getMoney
public static Money getMoney(BigDecimal amount,
BroadleafCurrency currency)
getMoney
public static Money getMoney(BroadleafCurrency currency)
getCurrency
public static Currency getCurrency(Money money)
getCurrency
public static Currency getCurrency(BroadleafCurrency currency)
getUnitAmount
public static Money getUnitAmount(Money difference)
- Returns the unit amount (e.g. .01 for US and all other 2 decimal currencies)
- Parameters:
currency -
- Returns:
getUnitAmount
public static Money getUnitAmount(BroadleafCurrency blCurrency)
- Returns the unit amount (e.g. .01 for US and all other 2 decimal currencies)
- Parameters:
currency -
- Returns:
calculateRemainder
public static int calculateRemainder(Money totalAmount,
int quantity)
- Returns the remainder amount if the passed in totalAmount was divided by the
quantity taking into account the normal unit of the currency (e.g. .01 for US).
- Parameters:
currency -
- Returns:
Copyright © 2013. All Rights Reserved.