mirror of
https://github.com/apache/poi.git
synced 2025-02-07 18:48:20 +00:00
[bug-69529] try to workaround cells with numeric type whose format cannot be applied
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1922986 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
116c32137d
commit
b0515e7493
@ -396,6 +396,10 @@ public class XSSFSheetXMLHandler extends DefaultHandler {
|
||||
thisStr = formatter.formatRawCellContents(d, this.formatIndex, this.formatString);
|
||||
} catch (NumberFormatException e) {
|
||||
// Formula is a String result not a Numeric one
|
||||
LOG.atInfo().log(
|
||||
"Error formatting cell '{}' - will use its raw value instead (format '{}')",
|
||||
cellRef,
|
||||
this.formatString);
|
||||
thisStr = fv;
|
||||
}
|
||||
} else {
|
||||
@ -431,8 +435,10 @@ public class XSSFSheetXMLHandler extends DefaultHandler {
|
||||
thisStr = formatter.formatRawCellContents(
|
||||
Double.parseDouble(n), this.formatIndex, this.formatString);
|
||||
} catch (NumberFormatException e) {
|
||||
LOG.atInfo().log("Error formatting cell '{}' - will use its raw value instead",
|
||||
cellRef);
|
||||
LOG.atInfo().log(
|
||||
"Error formatting cell '{}' - will use its raw value instead (format '{}')",
|
||||
cellRef,
|
||||
this.formatString);
|
||||
thisStr = n;
|
||||
}
|
||||
} else {
|
||||
|
Loading…
x
Reference in New Issue
Block a user