summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKHobbits <rob@khobbits.co.uk>2011-07-28 03:49:10 +0100
committerKHobbits <rob@khobbits.co.uk>2011-07-28 03:49:10 +0100
commitbb6b2c9374964289477b540bb83a3dabcb101a4c (patch)
tree9da426187ba7b9b7cf16bb9209cf7cc4f02160fc
parentdf47aad478572c88927b4f6c040a649e2b685a62 (diff)
parent9eb73cf854943c5ff1accdc855347b543fdb8a3e (diff)
downloadEssentials-bb6b2c9374964289477b540bb83a3dabcb101a4c.tar
Essentials-bb6b2c9374964289477b540bb83a3dabcb101a4c.tar.gz
Essentials-bb6b2c9374964289477b540bb83a3dabcb101a4c.tar.lz
Essentials-bb6b2c9374964289477b540bb83a3dabcb101a4c.tar.xz
Essentials-bb6b2c9374964289477b540bb83a3dabcb101a4c.zip
Merge branch 'master' of github.com:essentials/Essentials
-rw-r--r--Essentials/src/com/earth2me/essentials/signs/SignTrade.java7
1 files changed, 6 insertions, 1 deletions
diff --git a/Essentials/src/com/earth2me/essentials/signs/SignTrade.java b/Essentials/src/com/earth2me/essentials/signs/SignTrade.java
index 6c0205d34..37f56d9fb 100644
--- a/Essentials/src/com/earth2me/essentials/signs/SignTrade.java
+++ b/Essentials/src/com/earth2me/essentials/signs/SignTrade.java
@@ -98,9 +98,14 @@ public class SignTrade extends EssentialsSign
if (split.length == 2 && amountNeeded)
{
final Double money = getMoney(split[0]);
- final Double amount = getDoublePositive(split[1]);
+ Double amount = getDoublePositive(split[1]);
if (money != null && amount != null)
{
+ amount -= amount % money;
+ if (amount < 0.01 || money < 0.01)
+ {
+ throw new SignException(Util.i18n("moreThanZero"));
+ }
sign.setLine(index, Util.formatCurrency(money, ess) + ":" + Util.formatCurrency(amount, ess).substring(1));
return;
}