diff options
author | PJ Fanning <fanningpj@apache.org> | 2021-11-25 05:27:51 +0000 |
---|---|---|
committer | PJ Fanning <fanningpj@apache.org> | 2021-11-25 05:27:51 +0000 |
commit | a1a169334fe845744fc78408592aaa27ad8ea376 (patch) | |
tree | 588fecb4cb5f8a61cbe73d27261f53e402c3b53f /poi/src | |
parent | b9d1e9c27f12676e17464e3d52bf4734b93fbd52 (diff) | |
download | poi-a1a169334fe845744fc78408592aaa27ad8ea376.tar.gz poi-a1a169334fe845744fc78408592aaa27ad8ea376.zip |
[bug-63211] fix issue with escaped % in custom number format
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1895313 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'poi/src')
-rw-r--r-- | poi/src/main/java/org/apache/poi/ss/usermodel/DataFormatter.java | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/poi/src/main/java/org/apache/poi/ss/usermodel/DataFormatter.java b/poi/src/main/java/org/apache/poi/ss/usermodel/DataFormatter.java index b8bd933a9a..ed3a447aab 100644 --- a/poi/src/main/java/org/apache/poi/ss/usermodel/DataFormatter.java +++ b/poi/src/main/java/org/apache/poi/ss/usermodel/DataFormatter.java @@ -606,7 +606,10 @@ public class DataFormatter { } - private String cleanFormatForNumber(String formatStr) { + private String cleanFormatForNumber(String formatStrIn) { + // this replace is done to fix https://bz.apache.org/bugzilla/show_bug.cgi?id=63211 + String formatStr = formatStrIn.replace("\\%", "\'%\'"); + StringBuilder sb = new StringBuilder(formatStr); if (emulateCSV) { |