public interface Currency extends CatalogType
Unlike other CatalogType
s, Currency has no predefined
values. Unless a plugin has specific knowledge of a particular currency
provided by an economy plugin, EconomyService.getDefaultCurrency()
should usually be used.
Depending on the provider of the EconomyService
, more currencies may be available.
Modifier and Type | Method and Description |
---|---|
default Text |
format(BigDecimal amount)
Formats the given amount using the default number of fractional digits.
|
Text |
format(BigDecimal amount,
int numFractionDigits)
Formats the given amount using the specified number of fractional digits.
|
int |
getDefaultFractionDigits()
This is the default number of fractional digits that is utilized for
formatting purposes.
|
Text |
getDisplayName()
The currency's display name, in singular form.
|
Text |
getPluralDisplayName()
The currency's display name in plural form.
|
Text |
getSymbol()
The currency's symbol.
|
boolean |
isDefault()
Returns true if this currency is the default currency for the economy,
otherwise false.
|
getId, getName
Text getDisplayName()
This should be preferred over CatalogType.getName()
for display purposes.
Text getPluralDisplayName()
Not all currencies will have a plural name that differs from the display name.
Text getSymbol()
default Text format(BigDecimal amount)
Should include the symbol if it is present
amount
- The amount to formatText format(BigDecimal amount, int numFractionDigits)
Should include the symbol if it is present
amount
- The amount to formatnumFractionDigits
- The numer of fractional digits to useint getDefaultFractionDigits()
boolean isDefault()