From 05c79326befab7697466db902b76b96c72f6a698 Mon Sep 17 00:00:00 2001 From: PJ Fanning Date: Tue, 2 Jul 2024 00:32:59 +0000 Subject: [PATCH] another dataformatter test git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1918810 13f79535-47bb-0310-9956-ffa450edef68 --- .../poi/xssf/usermodel/TestXSSFDataFormat.java | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/poi-ooxml/src/test/java/org/apache/poi/xssf/usermodel/TestXSSFDataFormat.java b/poi-ooxml/src/test/java/org/apache/poi/xssf/usermodel/TestXSSFDataFormat.java index f73060c917..4f512a1d55 100644 --- a/poi-ooxml/src/test/java/org/apache/poi/xssf/usermodel/TestXSSFDataFormat.java +++ b/poi-ooxml/src/test/java/org/apache/poi/xssf/usermodel/TestXSSFDataFormat.java @@ -158,4 +158,18 @@ public final class TestXSSFDataFormat extends BaseTestDataFormat { */ } } + + @Test + public void testFormatCellValueDecimal() throws IOException { + DataFormatter df = new DataFormatter(); + + try (Workbook wb = new XSSFWorkbook()) { + Cell cell = wb.createSheet("test").createRow(0).createCell(0); + assertEquals("", df.formatCellValue(cell)); + + cell.setCellValue(1.005); + assertEquals("1.005", df.formatCellValue(cell)); + } + } + } -- 2.39.5