]> source.dussan.org Git - poi.git/commitdiff
[github-487] Round up seconds in CellElapsedFormatter. Thanks to Anthony Schott....
authorPJ Fanning <fanningpj@apache.org>
Mon, 24 Jul 2023 10:12:46 +0000 (10:12 +0000)
committerPJ Fanning <fanningpj@apache.org>
Mon, 24 Jul 2023 10:12:46 +0000 (10:12 +0000)
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1911228 13f79535-47bb-0310-9956-ffa450edef68

poi/src/main/java/org/apache/poi/ss/format/CellElapsedFormatter.java
test-data/spreadsheet/ElapsedFormatTests.xlsx

index 43069d2eabe61c0d0c959928879a1181beff31fd..93fc537d12443bb4d8f0a25c4177ac3fc37bf3df 100644 (file)
@@ -59,7 +59,7 @@ public class CellElapsedFormatter extends CellFormatter {
                 val = elapsed / factor;
             else
                 val = elapsed / factor % modBy;
-            if (type == '0')
+            if (type == '0' || type == 's')
                 return Math.round(val);
             else
                 return (long) val;
index 95a093e8d4655440dba1c384fb12542587ecf7cd..eacc071a41343d0a0cfa3f29ed6ddcc993837b7f 100644 (file)
Binary files a/test-data/spreadsheet/ElapsedFormatTests.xlsx and b/test-data/spreadsheet/ElapsedFormatTests.xlsx differ