Skip to main content

🔢 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).
Formula: 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: 0 or 1.
  • Interactive chat / item lore (more detail): decimals: 1 or 2.

5. Overriding suffixes per currency

In multi-currency, each <cid> can have its own table:
Result:

6. Placeholders that use abbreviation

  • %vault_eco_balance_short% — abbreviates default currency, 1 decimal (per abbreviate.decimals).
  • %vault_top_amount_<n>% — top entries use abbreviation by default if the config has it enabled.
  • %vault2_balance_formatted_<cid>% — uses economy.format(cid, amount) → abbreviates per currencies.<cid>.abbreviate.*.

7. Java implementation (reference)

Pseudocode of SimpleEconomy.abbreviate(double amount, CurrencyDef def):
If your server operates with figures above 1 quadrillion (1e15) manually add an extra suffix by editing SimpleEconomy.java (in v2.1 t is the ceiling).