]> source.dussan.org Git - poi.git/commitdiff
[bug-62857] support locale
authorPJ Fanning <fanningpj@apache.org>
Thu, 3 Feb 2022 15:27:23 +0000 (15:27 +0000)
committerPJ Fanning <fanningpj@apache.org>
Thu, 3 Feb 2022 15:27:23 +0000 (15:27 +0000)
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1897730 13f79535-47bb-0310-9956-ffa450edef68

poi/src/main/java/org/apache/poi/ss/formula/functions/NumericFunction.java

index 3a3bc4760c1016e00b1f43c27b8edd3321f97558..4402ed49d7f4ae5fb2c09e256c0c2254ea54aafe 100644 (file)
@@ -26,7 +26,6 @@ import java.math.BigDecimal;
 import java.math.BigInteger;
 import java.math.MathContext;
 import java.text.DecimalFormat;
-import java.text.DecimalFormatSymbols;
 import java.text.NumberFormat;
 
 public abstract class NumericFunction implements Function {
@@ -104,20 +103,6 @@ public abstract class NumericFunction implements Function {
                 val = bigInt.doubleValue();
             }
 
-            StringBuilder decimalPlacesFormat = new StringBuilder();
-            if (nPlaces > 0) {
-                decimalPlacesFormat.append('.');
-            }
-            for (int i = 0; i < nPlaces; i++) {
-                decimalPlacesFormat.append('0');
-            }
-            StringBuilder decimalFormatString = new StringBuilder();
-            decimalFormatString.append("¤#,##0").append(decimalPlacesFormat)
-                    .append(";(¤#,##0").append(decimalPlacesFormat).append(')');
-
-            DecimalFormatSymbols symbols = DecimalFormatSymbols.getInstance(LocaleUtil.getUserLocale());
-            DecimalFormat df = new DecimalFormat(decimalFormatString.toString(), symbols);
-
             DecimalFormat nf = (DecimalFormat) NumberFormat.getCurrencyInstance(LocaleUtil.getUserLocale());
             int decimalPlaces = nPlaces < 0 ? 0 : nPlaces;
             if (LocaleUtil.getUserLocale().getCountry().equalsIgnoreCase("US")) {