diff options
author | PJ Fanning <fanningpj@apache.org> | 2022-02-03 15:27:23 +0000 |
---|---|---|
committer | PJ Fanning <fanningpj@apache.org> | 2022-02-03 15:27:23 +0000 |
commit | 6200f7975895c28fc89ab13c095d776891436960 (patch) | |
tree | 0b5517929b0e7a4c5830225866fb185f84279fa9 | |
parent | 77bcd7759067dbc1baa058ccafe762d86dcbcbbb (diff) | |
download | poi-6200f7975895c28fc89ab13c095d776891436960.tar.gz poi-6200f7975895c28fc89ab13c095d776891436960.zip |
[bug-62857] support locale
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1897730 13f79535-47bb-0310-9956-ffa450edef68
-rw-r--r-- | poi/src/main/java/org/apache/poi/ss/formula/functions/NumericFunction.java | 15 |
1 files changed, 0 insertions, 15 deletions
diff --git a/poi/src/main/java/org/apache/poi/ss/formula/functions/NumericFunction.java b/poi/src/main/java/org/apache/poi/ss/formula/functions/NumericFunction.java index 3a3bc4760c..4402ed49d7 100644 --- a/poi/src/main/java/org/apache/poi/ss/formula/functions/NumericFunction.java +++ b/poi/src/main/java/org/apache/poi/ss/formula/functions/NumericFunction.java @@ -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")) { |