mirror of
https://github.com/Auxilor/EcoBits.git
synced 2025-12-19 15:09:19 +00:00
Added %ecobits_<id>_commas%
This commit is contained in:
@@ -120,6 +120,15 @@ class Currency(
|
|||||||
}
|
}
|
||||||
)
|
)
|
||||||
|
|
||||||
|
PlaceholderManager.registerPlaceholder(
|
||||||
|
PlayerPlaceholder(
|
||||||
|
plugin,
|
||||||
|
"${id}_commas"
|
||||||
|
) {
|
||||||
|
it.getBalance(this).formatWithCommas()
|
||||||
|
}
|
||||||
|
)
|
||||||
|
|
||||||
PlaceholderManager.registerPlaceholder(
|
PlaceholderManager.registerPlaceholder(
|
||||||
PlayerPlaceholder(
|
PlayerPlaceholder(
|
||||||
plugin,
|
plugin,
|
||||||
@@ -182,6 +191,10 @@ fun BigDecimal.formatWithExtension(): String {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
fun BigDecimal.formatWithCommas(): String {
|
||||||
|
return DecimalFormat("#,###.00").format(this)
|
||||||
|
}
|
||||||
|
|
||||||
fun OfflinePlayer.getBalance(currency: Currency): BigDecimal {
|
fun OfflinePlayer.getBalance(currency: Currency): BigDecimal {
|
||||||
return this.profile.read(currency.key)
|
return this.profile.read(currency.key)
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -9,6 +9,7 @@
|
|||||||
|
|
||||||
# Placeholders:
|
# Placeholders:
|
||||||
# %ecobits_<id>% - The balance of a certain currency
|
# %ecobits_<id>% - The balance of a certain currency
|
||||||
|
# %ecobits_<id>_commas% - The balance with commas of a certain currency
|
||||||
# %ecobits_<id>_formatted% - The formatted balance of a certain currency
|
# %ecobits_<id>_formatted% - The formatted balance of a certain currency
|
||||||
# %ecobits_<id>_max% - The max balance of a certain currency
|
# %ecobits_<id>_max% - The max balance of a certain currency
|
||||||
# %ecobits_<id>_default% - The default balance of a certain currency
|
# %ecobits_<id>_default% - The default balance of a certain currency
|
||||||
|
|||||||
Reference in New Issue
Block a user