summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKHobbits <rob@khobbits.co.uk>2013-04-30 00:35:39 +0100
committerKHobbits <rob@khobbits.co.uk>2013-04-30 00:35:39 +0100
commit7913cfdb3ce56e7e26835670c4109511d0cd650f (patch)
tree0cfde14e9fdc436787fe64ea067495901f0f3870
parent137d0df9dcc7d9d4da78a0219b93cb5edb17801a (diff)
downloadEssentials-7913cfdb3ce56e7e26835670c4109511d0cd650f.tar
Essentials-7913cfdb3ce56e7e26835670c4109511d0cd650f.tar.gz
Essentials-7913cfdb3ce56e7e26835670c4109511d0cd650f.tar.lz
Essentials-7913cfdb3ce56e7e26835670c4109511d0cd650f.tar.xz
Essentials-7913cfdb3ce56e7e26835670c4109511d0cd650f.zip
Fix currency rounding up.
-rw-r--r--Essentials/src/com/earth2me/essentials/Util.java7
1 files changed, 2 insertions, 5 deletions
diff --git a/Essentials/src/com/earth2me/essentials/Util.java b/Essentials/src/com/earth2me/essentials/Util.java
index f1d0485c3..677aa230f 100644
--- a/Essentials/src/com/earth2me/essentials/Util.java
+++ b/Essentials/src/com/earth2me/essentials/Util.java
@@ -1,6 +1,7 @@
package com.earth2me.essentials;
import static com.earth2me.essentials.I18n._;
+import java.math.RoundingMode;
import java.text.DecimalFormat;
import java.text.DecimalFormatSymbols;
import java.util.*;
@@ -524,6 +525,7 @@ public class Util
public static String formatAsCurrency(final double value)
{
+ dFormat.setRoundingMode(RoundingMode.FLOOR);
String str = dFormat.format(value);
if (str.endsWith(".00"))
{
@@ -542,11 +544,6 @@ public class Util
return ess.getSettings().getCurrencySymbol() + formatAsCurrency(value);
}
- public static double roundDouble(final double d)
- {
- return Math.round(d * 100.0) / 100.0;
- }
-
public static boolean isInt(final String sInt)
{
try