summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorementalo <ementalo@e251c2fe-e539-e718-e476-b85c1f46cddb>2011-05-06 20:55:12 +0000
committerementalo <ementalo@e251c2fe-e539-e718-e476-b85c1f46cddb>2011-05-06 20:55:12 +0000
commitc160d9c74d13db933a5bb97784dbd8f8493d4d07 (patch)
treea64654672439c0fc507a2ae8b48c8f42d260a75d
parent9271e8eb3a11bfba1b5a588e7ed3942a144ba87b (diff)
downloadEssentials-c160d9c74d13db933a5bb97784dbd8f8493d4d07.tar
Essentials-c160d9c74d13db933a5bb97784dbd8f8493d4d07.tar.gz
Essentials-c160d9c74d13db933a5bb97784dbd8f8493d4d07.tar.lz
Essentials-c160d9c74d13db933a5bb97784dbd8f8493d4d07.tar.xz
Essentials-c160d9c74d13db933a5bb97784dbd8f8493d4d07.zip
[trunk] fix doubles in signs and output display
git-svn-id: https://svn.java.net/svn/essentials~svn/trunk@1355 e251c2fe-e539-e718-e476-b85c1f46cddb
-rw-r--r--Essentials/src/com/earth2me/essentials/EssentialsEcoBlockListener.java6
1 files changed, 3 insertions, 3 deletions
diff --git a/Essentials/src/com/earth2me/essentials/EssentialsEcoBlockListener.java b/Essentials/src/com/earth2me/essentials/EssentialsEcoBlockListener.java
index c8266e910..1fa0440a4 100644
--- a/Essentials/src/com/earth2me/essentials/EssentialsEcoBlockListener.java
+++ b/Essentials/src/com/earth2me/essentials/EssentialsEcoBlockListener.java
@@ -161,8 +161,8 @@ public class EssentialsEcoBlockListener extends BlockListener
String[] l2 = event.getLines()[2].split("[ :-]+");
boolean m1 = l1[0].matches("\\$[0-9]+(\\.[0-9]+)?");
boolean m2 = l2[0].matches("\\$[0-9]+(\\.[0-9]+)?");
- int q1 = Integer.parseInt(m1 ? l1[0].substring(1) : l1[0]);
- int q2 = Integer.parseInt(m2 ? l2[0].substring(1) : l2[0]);
+ double q1 = Double.parseDouble(m1 ? l1[0].substring(1) : l1[0]);
+ double q2 = Double.parseDouble(m2 ? l2[0].substring(1) : l2[0]);
double r2 = Double.parseDouble(l2[m2 ? 1 : 2]);
r2 = r2 - r2 % q2;
if (q1 < 1 || q2 < 1 || r2 < 1)
@@ -196,7 +196,7 @@ public class EssentialsEcoBlockListener extends BlockListener
event.setLine(0, "§1[Trade]");
event.setLine(1, (m1 ? "$" + q1 : q1 + " " + l1[1]) + ":0");
- event.setLine(2, (m2 ? "$" + q2 : q2 + " " + l2[1]) + ":" + r2);
+ event.setLine(2, (m2 ? "$" + q2 : String.format("%.0f", q2)+ " " + l2[1]) + ":" + String.format("%.0f",r2));
event.setLine(3, "§8" + username);
}
catch (Throwable ex)