use math.round for GoldIsMoney

This commit is contained in:
Sleaker 2012-07-23 19:14:02 -07:00
parent 90a9987891
commit 396da3f3a4

View File

@ -82,7 +82,7 @@ public class Economy_GoldIsMoney implements Economy {
return new EconomyResponse(0, 0, ResponseType.FAILURE, "Cannot withdraw negative funds"); return new EconomyResponse(0, 0, ResponseType.FAILURE, "Cannot withdraw negative funds");
} }
if (GoldIsMoney.has(playerName, (long) amount)) { if (GoldIsMoney.has(playerName, Math.round(amount))) {
GoldIsMoney.withdrawPlayer(playerName, (long) amount); GoldIsMoney.withdrawPlayer(playerName, (long) amount);
return new EconomyResponse(amount, getAccountBalance(playerName), ResponseType.SUCCESS, null); return new EconomyResponse(amount, getAccountBalance(playerName), ResponseType.SUCCESS, null);
} else { } else {
@ -96,7 +96,7 @@ public class Economy_GoldIsMoney implements Economy {
return new EconomyResponse(0, 0, ResponseType.FAILURE, "Cannot desposit negative funds"); return new EconomyResponse(0, 0, ResponseType.FAILURE, "Cannot desposit negative funds");
} }
GoldIsMoney.depositPlayer(playerName, (long) amount); GoldIsMoney.depositPlayer(playerName, Math.round(amount));
return new EconomyResponse(amount, GoldIsMoney.getBalance(playerName), EconomyResponse.ResponseType.SUCCESS, null); return new EconomyResponse(amount, GoldIsMoney.getBalance(playerName), EconomyResponse.ResponseType.SUCCESS, null);
} }
@ -132,7 +132,7 @@ public class Economy_GoldIsMoney implements Economy {
@Override @Override
public String format(double amount) { public String format(double amount) {
return GoldIsMoney.format((long) Math.round(amount)); return GoldIsMoney.format(Math.round(amount));
} }
@Override @Override