Author: fanningpj
Date: Thu Feb 3 15:27:23 2022
New Revision: 1897730
URL: http://svn.apache.org/viewvc?rev=1897730&view=rev
Log:
[bug-62857] support locale
Modified:
poi/trunk/poi/src/main/java/org/apache/poi/ss/formula/functions/NumericFunction.java
Modified:
poi/trunk/poi/src/main/java/org/apache/poi/ss/formula/functions/NumericFunction.java
URL:
http://svn.apache.org/viewvc/poi/trunk/poi/src/main/java/org/apache/poi/ss/formula/functions/NumericFunction.java?rev=1897730&r1=1897729&r2=1897730&view=diff
==============================================================================
---
poi/trunk/poi/src/main/java/org/apache/poi/ss/formula/functions/NumericFunction.java
(original)
+++
poi/trunk/poi/src/main/java/org/apache/poi/ss/formula/functions/NumericFunction.java
Thu Feb 3 15:27:23 2022
@@ -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 im
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")) {
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]