🔢 Currency Abbreviation
When a balance reaches the thousands, Vault can automatically abbreviate it using suffixes (k, m, b, t) instead of showing the full figure. Used mainly in leaderboards (Tablist, Scoreboards via PlaceholderAPI) and in the %vault_eco_balance_short% placeholder.
1. currency.abbreviate.* block
2. Abbreviation rule (thresholds)
The abbreviation function compares the absolute value against 1000, 1 000 000, 1 000 000 000, 1 000 000 000 000 and picks the smallest suffix that can represent the number. If it is< 1000 no abbreviation happens and it returns the normal number (with 2 decimals).
displayValue = |value| / divisor (rounded to abbreviate.decimals decimals).
3. Examples with decimals: 1 and default suffixes
Let amount = X, suffix.k = "k", suffix.m = "m", suffix.b = "b", suffix.t = "t":
4. Varying abbreviate.decimals
Recommendation:
- Tablist / Scoreboard (tight spaces):
decimals: 0or1. - Interactive chat / item lore (more detail):
decimals: 1or2.
5. Overriding suffixes per currency
In multi-currency, each<cid> can have its own table:
6. Placeholders that use abbreviation
%vault_eco_balance_short%— abbreviatesdefaultcurrency, 1 decimal (perabbreviate.decimals).%vault_top_amount_<n>%— top entries use abbreviation by default if the config has it enabled.%vault2_balance_formatted_<cid>%— useseconomy.format(cid, amount)→ abbreviates percurrencies.<cid>.abbreviate.*.
7. Java implementation (reference)
Pseudocode ofSimpleEconomy.abbreviate(double amount, CurrencyDef def):
1e15) manually add an extra suffix by editing SimpleEconomy.java (in v2.1 t is the ceiling).