mirror of
https://github.com/MassiveCraft/Factions.git
synced 2024-12-04 16:13:24 +01:00
Add decimal format for showing money to TL file
This commit is contained in:
parent
fe7002f674
commit
769722ddb4
@ -8,6 +8,7 @@ import com.massivecraft.factions.iface.EconomyParticipator;
|
|||||||
import com.massivecraft.factions.struct.Permission;
|
import com.massivecraft.factions.struct.Permission;
|
||||||
import com.massivecraft.factions.struct.Role;
|
import com.massivecraft.factions.struct.Role;
|
||||||
import com.massivecraft.factions.util.RelationUtil;
|
import com.massivecraft.factions.util.RelationUtil;
|
||||||
|
import com.massivecraft.factions.zcore.util.TL;
|
||||||
import net.milkbowl.vault.economy.Economy;
|
import net.milkbowl.vault.economy.Economy;
|
||||||
import net.milkbowl.vault.economy.EconomyResponse;
|
import net.milkbowl.vault.economy.EconomyResponse;
|
||||||
import org.bukkit.Bukkit;
|
import org.bukkit.Bukkit;
|
||||||
@ -340,9 +341,8 @@ public class Econ {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// format money string based on server's set currency type, like "24 gold" or "$24.50"
|
|
||||||
public static String moneyString(double amount) {
|
public static String moneyString(double amount) {
|
||||||
return econ.format(amount);
|
return format.format(amount);
|
||||||
}
|
}
|
||||||
|
|
||||||
// calculate the cost for claiming land
|
// calculate the cost for claiming land
|
||||||
@ -387,7 +387,7 @@ public class Econ {
|
|||||||
return econ.getBalance(account);
|
return econ.getBalance(account);
|
||||||
}
|
}
|
||||||
|
|
||||||
private static final DecimalFormat format = new DecimalFormat("#,###");
|
private static final DecimalFormat format = new DecimalFormat(TL.ECON_FORMAT.toString());
|
||||||
|
|
||||||
public static String getFriendlyBalance(UUID uuid) {
|
public static String getFriendlyBalance(UUID uuid) {
|
||||||
OfflinePlayer offline = Bukkit.getOfflinePlayer(uuid);
|
OfflinePlayer offline = Bukkit.getOfflinePlayer(uuid);
|
||||||
|
@ -629,6 +629,7 @@ public enum TL {
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
ECON_OFF("no %s"), // no balance, no value, no refund, etc
|
ECON_OFF("no %s"), // no balance, no value, no refund, etc
|
||||||
|
ECON_FORMAT("###,###.###"),
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Relations
|
* Relations
|
||||||
|
Loading…
Reference in New Issue
Block a user