public class BroadleafCurrencyUtils extends Object
BroadleafCurrency}
Modifier and Type | Field and Description |
---|---|
protected static Map<String,NumberFormat> |
FORMAT_CACHE |
static MathContext |
ROUND_FLOOR_MATH_CONTEXT |
Constructor and Description |
---|
BroadleafCurrencyUtils() |
Modifier and Type | Method and Description |
---|---|
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.
|
static Currency |
getCurrency(BroadleafCurrency currency) |
static Currency |
getCurrency(Money money) |
static Money |
getMoney(BigDecimal amount) |
static Money |
getMoney(BigDecimal amount,
BroadleafCurrency currency) |
static Money |
getMoney(BroadleafCurrency currency) |
static NumberFormat |
getNumberFormatFromCache(Locale locale,
Currency currency)
Provides a cached approach for creating NumberFormat instances.
|
static Money |
getUnitAmount(BroadleafCurrency blCurrency)
Returns the unit amount (e.g.
|
static Money |
getUnitAmount(Money difference)
Returns the unit amount (e.g.
|
protected static final Map<String,NumberFormat> FORMAT_CACHE
public static final MathContext ROUND_FLOOR_MATH_CONTEXT
public static Money getMoney(BigDecimal amount, BroadleafCurrency currency)
public static Money getMoney(BigDecimal amount)
public static Money getMoney(BroadleafCurrency currency)
public static Currency getCurrency(BroadleafCurrency currency)
public static Money getUnitAmount(Money difference)
difference
- public static Money getUnitAmount(BroadleafCurrency blCurrency)
blCurrency
- public static int calculateRemainder(Money totalAmount, int quantity)
totalAmount
- quantity
- public static NumberFormat getNumberFormatFromCache(Locale locale, Currency currency)
locale
- the Localecurrency
- the CurrencyCopyright © 2022. All rights reserved.