From 803b591ff4e0ef114c60e62053c0346fcef4f08a Mon Sep 17 00:00:00 2001 From: zOnlyKroks Date: Wed, 29 Dec 2021 09:29:55 +0100 Subject: [PATCH] Format --- src/de/steamwar/bungeecore/commands/PlaytimeCommand.java | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src/de/steamwar/bungeecore/commands/PlaytimeCommand.java b/src/de/steamwar/bungeecore/commands/PlaytimeCommand.java index 468fae8d..e570db1b 100644 --- a/src/de/steamwar/bungeecore/commands/PlaytimeCommand.java +++ b/src/de/steamwar/bungeecore/commands/PlaytimeCommand.java @@ -25,6 +25,9 @@ import net.md_5.bungee.api.CommandSender; import net.md_5.bungee.api.connection.ProxiedPlayer; import java.text.DecimalFormat; +import java.text.Format; +import java.text.NumberFormat; +import java.util.Locale; public class PlaytimeCommand extends BasicCommand{ @@ -37,6 +40,10 @@ public class PlaytimeCommand extends BasicCommand{ if(!(sender instanceof ProxiedPlayer)) return; - Message.send("HOURS_PLAYED", sender, new DecimalFormat("###.##").format((SteamwarUser.get((ProxiedPlayer) sender).getOnlinetime() / (double) 3600))); + NumberFormat format = NumberFormat.getNumberInstance(Locale.GERMAN); + format.setMaximumFractionDigits(2); + format.format((SteamwarUser.get((ProxiedPlayer) sender).getOnlinetime() / (double) 3600)); + + Message.send("HOURS_PLAYED", sender, format); } }