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

poi/src/test/java/org/apache/poi/ss/formula/functions/TestNumericFunction.java

index 6f86b131cd1624ae6506691516466a36bf0352fa..cd6071bad7eda36e8aa62e0da2155ee268c1f486 100644 (file)
@@ -115,4 +115,18 @@ final class TestNumericFunction {
             LocaleUtil.setUserLocale(defaultLocale);
         }
     }
+
+    @Test
+    void testDOLLARDenmark() {
+        Locale defaultLocale = LocaleUtil.getUserLocale();
+        try {
+            LocaleUtil.setUserLocale(new Locale("da", "DK"));
+            HSSFWorkbook wb = new HSSFWorkbook();
+            HSSFCell cell = wb.createSheet().createRow(0).createCell(0);
+            HSSFFormulaEvaluator fe = new HSSFFormulaEvaluator(wb);
+            assertString(fe, cell, "DOLLAR(1234.567,2)", "kr.1,234.57");
+        } finally {
+            LocaleUtil.setUserLocale(defaultLocale);
+        }
+    }
 }