public class BroadleafCurrencyUtils extends Object
BroadleafCurrency}| Modifier and Type | Class and Description |
|---|---|
static class |
BroadleafCurrencyUtils.CurrencyLocation |
| 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.
|
protected static BroadleafCurrencyUtils.CurrencyLocation |
currencyLocation(String location) |
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 NumberFormat |
getNumberFormatFromCache(Locale locale,
Currency currency,
String location,
List<String> currencyCodes) |
static Money |
getUnitAmount(BroadleafCurrency blCurrency)
Returns the unit amount (e.g.
|
static Money |
getUnitAmount(Money difference)
Returns the unit amount (e.g.
|
protected static void |
prefixCurrencyLocation(DecimalFormat format,
List<String> currencyCodes) |
protected static void |
specifyCurrencyLocation(DecimalFormat format,
String location,
List<String> currencyCodes) |
protected static void |
suffixCurrencyLocation(DecimalFormat format,
List<String> currencyCodes) |
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 Currencypublic static NumberFormat getNumberFormatFromCache(Locale locale, Currency currency, String location, List<String> currencyCodes)
protected static void specifyCurrencyLocation(DecimalFormat format, String location, List<String> currencyCodes)
protected static BroadleafCurrencyUtils.CurrencyLocation currencyLocation(String location)
protected static void suffixCurrencyLocation(DecimalFormat format, List<String> currencyCodes)
protected static void prefixCurrencyLocation(DecimalFormat format, List<String> currencyCodes)
Copyright © 2024. All rights reserved.