Package com.patelheet.capitalengine.api
Interface Currency
public interface Currency
The server's single currency. Amounts are
long counts of the smallest unit.-
Method Summary
Modifier and TypeMethodDescriptionintdecimals()Decimal places (2 means 12345 is 123.45).format(long amount) Formats using the owner's configured format, for example"123.45 coins".longParses player input such as"12","1.5","1.5k"or"2m".plural()Plural name, for example "coins".singular()Singular name, for example "coin".symbol()Symbol, for example "⛁".
-
Method Details
-
singular
String singular()Singular name, for example "coin". -
plural
String plural()Plural name, for example "coins". -
symbol
String symbol()Symbol, for example "⛁". -
decimals
int decimals()Decimal places (2 means 12345 is 123.45). -
format
Formats using the owner's configured format, for example"123.45 coins". -
parse
Parses player input such as"12","1.5","1.5k"or"2m".- Returns:
- the amount in the smallest unit
- Throws:
IllegalArgumentException- if the text isn't a valid amount for this currency
-