summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorementalo <ementalo@e251c2fe-e539-e718-e476-b85c1f46cddb>2011-05-11 15:11:07 +0000
committerementalo <ementalo@e251c2fe-e539-e718-e476-b85c1f46cddb>2011-05-11 15:11:07 +0000
commit3f45eb6d9be6cf4b9279128e06b51be78b862281 (patch)
tree74fa330a7387e29ca4fdbcf3e92ada350b58ad76
parent81dfdb102abc8f70d2302548392d1ff031163f32 (diff)
downloadEssentials-3f45eb6d9be6cf4b9279128e06b51be78b862281.tar
Essentials-3f45eb6d9be6cf4b9279128e06b51be78b862281.tar.gz
Essentials-3f45eb6d9be6cf4b9279128e06b51be78b862281.tar.lz
Essentials-3f45eb6d9be6cf4b9279128e06b51be78b862281.tar.xz
Essentials-3f45eb6d9be6cf4b9279128e06b51be78b862281.zip
[trunk] temp double fix, we should probably change doubles to decimals in prices
git-svn-id: https://svn.java.net/svn/essentials~svn/trunk@1420 e251c2fe-e539-e718-e476-b85c1f46cddb
-rw-r--r--Essentials/src/com/earth2me/essentials/EssentialsEcoPlayerListener.java5
1 files changed, 3 insertions, 2 deletions
diff --git a/Essentials/src/com/earth2me/essentials/EssentialsEcoPlayerListener.java b/Essentials/src/com/earth2me/essentials/EssentialsEcoPlayerListener.java
index 9233a6074..4d31c2f1e 100644
--- a/Essentials/src/com/earth2me/essentials/EssentialsEcoPlayerListener.java
+++ b/Essentials/src/com/earth2me/essentials/EssentialsEcoPlayerListener.java
@@ -44,7 +44,7 @@ public class EssentialsEcoPlayerListener extends PlayerListener
{
int amount = Integer.parseInt(sign.getLine(1));
ItemStack item = ItemDb.get(sign.getLine(2), amount);
- double cost = Double.parseDouble(sign.getLine(3).substring(1));
+ double cost = Double.parseDouble(sign.getLine(3).substring(1).replaceAll(",", "."));
if (user.getMoney() < cost)
{
throw new Exception(Util.i18n("notEnoughMoney"));
@@ -70,7 +70,8 @@ public class EssentialsEcoPlayerListener extends PlayerListener
{
int amount = Integer.parseInt(sign.getLine(1));
ItemStack item = ItemDb.get(sign.getLine(2), amount);
- double cost = Double.parseDouble(sign.getLine(3).substring(1));
+ double cost = Double.parseDouble(sign.getLine(3).substring(1).replaceAll(",", "."));
+
if (!InventoryWorkaround.containsItem(user.getInventory(), true, item))
{
throw new Exception(Util.format("missingItems", amount, sign.getLine(2)));