Skip to content

Commit

Permalink
format money number
Browse files Browse the repository at this point in the history
  • Loading branch information
minhh2792 committed Nov 30, 2024
1 parent e174a63 commit 874b518
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions dotman-plugin/src/main/java/net/minevn/dotman/Expansion.kt
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package net.minevn.dotman

import me.clip.placeholderapi.expansion.PlaceholderExpansion
import net.minevn.dotman.utils.Utils.Companion.format
import org.bukkit.entity.Player

class Expansion : PlaceholderExpansion() {
Expand All @@ -27,12 +28,12 @@ class Expansion : PlaceholderExpansion() {
val isPlayer = type == "player"
val top = LeaderBoard["${key}_ALL"]
val target = top[rank] ?: return if (isPlayer) "Chưa xếp hạng" else "0"
return if (isPlayer) target.first else target.second.toString()
return if (isPlayer) target.first.format() else target.second.format()
}
if (params.startsWith("data_") && args.size >= 2 && player != null) run data@{
val key = args.drop(1).joinToString("_").uppercase()
val playerData = PlayerData[player]
return playerData.data["${key}_ALL"]?.toString() ?: "0"
return playerData.data["${key}_ALL"]?.format() ?: "0"
}

return null
Expand Down

0 comments on commit 874b518

Please sign in to comment.