public class AmountToWordsUtil
extends java.lang.Object
Modifier and Type | Method and Description |
---|---|
java.lang.Object[] |
getCurrencyList()
Gives a list of currency codes recognized by the utility.
|
static AmountToWordsUtil |
getInstance()
Provides a shared instance of the AmountToWordsUtil.
|
java.lang.Object[] |
getLocalesList()
Gives a list of locales where corresponding spelloutrules can be found in the spelloutrules configuration file.
|
java.lang.String |
spellout(java.math.BigDecimal amount,
java.lang.String localeCode)
Converts a BigDecimal representation of a financial amount to words without any currency units.
|
java.lang.String |
spellout(java.math.BigDecimal amount,
java.lang.String localeCode,
java.lang.String currency,
java.lang.String format)
Converts a BigDecimal representation of a financial amount to words with a specified curency.
|
java.lang.String |
spellout(double amount,
java.lang.String localeCode)
Converts a double representation of a financial amount to words without any currency units.
|
java.lang.String |
spellout(java.lang.Double amount,
java.lang.String localeCode)
Converts a Double representation of a financial amount to words without any currency units.
|
java.lang.String |
spellout(double amount,
java.lang.String ifslangcode,
java.lang.String currency)
Converts a double representation of a financial amount to words using the default format.
|
java.lang.String |
spellout(double amount,
java.lang.String localeCode,
java.lang.String currency,
java.lang.String format)
Converts a double representation of a financial amount to words with a specified curency.
|
java.lang.String |
spellout(java.lang.Double amount,
java.lang.String localeCode,
java.lang.String currency,
java.lang.String format)
Converts a Double representation of a financial amount to words with a specified curency.
|
java.lang.String |
spellout(long amount,
java.lang.String localeCode)
Converts a long representation of a financial amount to words without any currency units.
|
java.lang.String |
spellout(java.lang.Long amount,
java.lang.String localeCode)
Converts a Long representation of a financial amount to words without any currency units.
|
java.lang.String |
spellout(long amount,
java.lang.String localeCode,
java.lang.String currency,
java.lang.String format)
Converts a long representation of a financial amount to words with a specified curency.
|
java.lang.String |
spellout(java.lang.Long amount,
java.lang.String localeCode,
java.lang.String currency,
java.lang.String format)
Converts a Long representation of a financial amount to words with a specified curency.
|
public static AmountToWordsUtil getInstance()
public java.lang.String spellout(double amount, java.lang.String ifslangcode, java.lang.String currency) throws UnknownCurrencyException
amount
- financial amountifslangcode
- ifs language that should be used for the conversion (e.g. en, fr, ja)UnknownCurrencyException
public java.lang.String spellout(java.math.BigDecimal amount, java.lang.String localeCode)
amount
- financial amountlocaleCode
- locale that should be used for the conversion (e.g. en_US)public java.lang.String spellout(long amount, java.lang.String localeCode)
amount
- financial amountlocaleCode
- locale that should be used for the conversion (e.g. en_US)public java.lang.String spellout(java.lang.Long amount, java.lang.String localeCode)
amount
- financial amountlocaleCode
- locale that should be used for the conversion (e.g. en_US)public java.lang.String spellout(java.lang.Double amount, java.lang.String localeCode)
amount
- financial amountlocaleCode
- locale that should be used for the conversion (e.g. en_US)public java.lang.String spellout(double amount, java.lang.String localeCode)
amount
- financial amountlocaleCode
- locale that should be used for the conversion (e.g. en_US)public java.lang.String spellout(java.math.BigDecimal amount, java.lang.String localeCode, java.lang.String currency, java.lang.String format) throws UnknownCurrencyException
spellout(double, String, String, String)
for a complete description.UnknownCurrencyException
public java.lang.String spellout(long amount, java.lang.String localeCode, java.lang.String currency, java.lang.String format) throws UnknownCurrencyException
spellout(double, String, String, String)
for a complete description.UnknownCurrencyException
public java.lang.String spellout(java.lang.Long amount, java.lang.String localeCode, java.lang.String currency, java.lang.String format) throws UnknownCurrencyException
spellout(double, String, String, String)
for a complete description.UnknownCurrencyException
public java.lang.String spellout(java.lang.Double amount, java.lang.String localeCode, java.lang.String currency, java.lang.String format) throws UnknownCurrencyException
spellout(double, String, String, String)
for a complete description.UnknownCurrencyException
public java.lang.String spellout(double amount, java.lang.String localeCode, java.lang.String currency, java.lang.String format) throws UnknownCurrencyException
amount
- financial amountlocaleCode
- locale that should be used for the conversion (e.g. en_US)currency
- curency code that should be used in resulting representationformat
- format of the resulting representation. Possible values are SpelloutRule.WITHOUT_CURRENCY,
SpelloutRule.CURRENCY_ONLY and SpelloutRule.CURRENCY_AND_HUNDREDTHS.UnknownCurrencyException
- if currency is not valid.public java.lang.Object[] getLocalesList()
public java.lang.Object[] getCurrencyList()