Hi guys, Im tryna make a plugin and I found this code: Code (Text): double balance = money; DecimalFormat df = new DecimalFormat("###,###,###,###,###.##"); String formattedBalance = df.format(balance); But I dont want comma's but I want dots instead but I get an error then. Spoiler: ERROR org.bukkit.event.EventException at org.bukkit.plugin.java.JavaPluginLoader$1.execute(JavaPluginLoader.java:310) ~[spigot-1.9.jar:git-Spigot-1a196e1-6f032cd] at org.bukkit.plugin.RegisteredListener.callEvent(RegisteredListener.java:62) ~[spigot-1.9.jar:git-Spigot-1a196e1-6f032cd] at org.bukkit.plugin.SimplePluginManager.fireEvent(SimplePluginManager.java:502) [spigot-1.9.jar:git-Spigot-1a196e1-6f032cd] at org.bukkit.plugin.SimplePluginManager.callEvent(SimplePluginManager.java:487) [spigot-1.9.jar:git-Spigot-1a196e1-6f032cd] at net.minecraft.server.v1_9_R1.PlayerList.onPlayerJoin(PlayerList.java:332) [spigot-1.9.jar:git-Spigot-1a196e1-6f032cd] at net.minecraft.server.v1_9_R1.PlayerList.a(PlayerList.java:158) [spigot-1.9.jar:git-Spigot-1a196e1-6f032cd] at net.minecraft.server.v1_9_R1.LoginListener.b(LoginListener.java:144) [spigot-1.9.jar:git-Spigot-1a196e1-6f032cd] at net.minecraft.server.v1_9_R1.LoginListener.c(LoginListener.java:54) [spigot-1.9.jar:git-Spigot-1a196e1-6f032cd] at net.minecraft.server.v1_9_R1.NetworkManager.a(NetworkManager.java:232) [spigot-1.9.jar:git-Spigot-1a196e1-6f032cd] at net.minecraft.server.v1_9_R1.ServerConnection.c(ServerConnection.java:141) [spigot-1.9.jar:git-Spigot-1a196e1-6f032cd] at net.minecraft.server.v1_9_R1.MinecraftServer.D(MinecraftServer.java:820) [spigot-1.9.jar:git-Spigot-1a196e1-6f032cd] at net.minecraft.server.v1_9_R1.DedicatedServer.D(DedicatedServer.java:400) [spigot-1.9.jar:git-Spigot-1a196e1-6f032cd] at net.minecraft.server.v1_9_R1.MinecraftServer.C(MinecraftServer.java:660) [spigot-1.9.jar:git-Spigot-1a196e1-6f032cd] at net.minecraft.server.v1_9_R1.MinecraftServer.run(MinecraftServer.java:559) [spigot-1.9.jar:git-Spigot-1a196e1-6f032cd] at java.lang.Thread.run(Unknown Source) [?:1.7.0_80] Caused by: java.lang.IllegalArgumentException: Multiple decimal separators in pattern "###.###.###.###.###,##" at java.text.DecimalFormat.applyPattern(Unknown Source) ~[?:1.7.0_80] at java.text.DecimalFormat.<init>(Unknown Source) ~[?:1.7.0_80] at me.justcedric.mrp.events.Join.ScoreboardUpdate(Join.java:76) ~[?:?] at me.justcedric.mrp.events.Join.onJoin(Join.java:60) ~[?:?] at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:1.7.0_80] at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) ~[?:1.7.0_80] at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) ~[?:1.7.0_80] at java.lang.reflect.Method.invoke(Unknown Source) ~[?:1.7.0_80] at org.bukkit.plugin.java.JavaPluginLoader$1.execute(JavaPluginLoader.java:306) ~[spigot-1.9.jar:git-Spigot-1a196e1-6f032cd] ... 14 more So my question is does someone know what code I can use?
You might be able to find something here: https://docs.oracle.com/javase/7/docs/api/java/text/DecimalFormat.html I'm at work at the moment so I can't really experiment for you.
This should help you out http://stackoverflow.com/questions/...ator-of-decimalformat-from-comma-to-dot-point Also, remember # means optional digit, and this is all that is necessary to define the format "#,###.##" but if you want to always have digits for a certain amount of places use something like "#,##0.00", etc.