貨幣格式Currency
控制 economy.format() 的輸出,所有透過 Vault API 顯示金額的插件都會套用。
currency:
symbol: "$" # 支援 & 色碼,例如 "&6$"
position: suffix # prefix / suffix / none
space: true # 符號與數字之間是否留空格
format: auto # DecimalFormat 樣式,auto 為自動
abbreviate:
enabled: false
decimals: 1
suffix:
k: k
m: m
b: b
t: t
position
| 值 | 輸出 |
|---|---|
suffix | 10 $ |
prefix | $ 10 |
none | 10 |
縮寫
abbreviate.enabled: true 時,1200 會顯示為 1.2k、
3400000 顯示為 3.4m。這只影響 format();
%vault_balance% 這類原始數值變數不受影響。
format
auto 時會先讀 Essentials 的 currency-format(若有安裝),
否則使用 #,##0.00。也可以直接填 Java DecimalFormat 樣式。
樣式無效時會記錄警告並退回預設值,不會讓插件無法啟動。
Controls the output of economy.format(), which every plugin displaying money
through the Vault API will use.
currency:
symbol: "$" # supports & colour codes, e.g. "&6$"
position: suffix # prefix / suffix / none
space: true # space between symbol and number
format: auto # DecimalFormat pattern, or auto
abbreviate:
enabled: false
decimals: 1
suffix:
k: k
m: m
b: b
t: t
position
| Value | Output |
|---|---|
suffix | 10 $ |
prefix | $ 10 |
none | 10 |
Abbreviation
With abbreviate.enabled: true, 1200 renders as 1.2k and 3400000 as
3.4m. This affects format() only; raw placeholders such as
%vault_balance% are unchanged.
format
auto reads Essentials' currency-format if Essentials is installed,
otherwise falls back to #,##0.00. You can also supply a Java
DecimalFormat pattern directly. An invalid pattern logs a warning and falls back to
the default rather than preventing startup.