We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
03格式excel,单元格为公式,并设置单元格格式为数值,2位小数。
触发Bug的代码
public class XLSBigDecimalConverter implements Converter<BigDecimal> { public Class<?> supportJavaTypeKey() { return BigDecimal.class; } public CellDataTypeEnum supportExcelTypeKey() { return CellDataTypeEnum.NUMBER; } public BigDecimal convertToJavaData(ReadCellData<?> cellData, ExcelContentProperty contentProperty, GlobalConfiguration globalConfiguration) throws Exception { BigDecimal val = cellData.getNumberValue(); if (cellData.getDataFormatData() != null) { String format = cellData.getDataFormatData().getFormat(); System.out.println(format); } return val; } public WriteCellData<?> convertToExcelData(BigDecimal value, ExcelContentProperty contentProperty, GlobalConfiguration globalConfiguration) throws Exception { return null; } }
cellData.getDataFormatData() 为空。代码错误应该在 FormulaRecordHandler 没有将DataFormat设置给tempCellData
The text was updated successfully, but these errors were encountered:
hello, please give me some time to fix it, thanks. If you have more detailed information, you can contact me or comment here.
Sorry, something went wrong.
@Melody0321 我也遇到了这个问题,表现是03版Excel, 单元格格式是 日期,公式是: Date(2022,5,6),排查下来, 是否可以修改类:FormulaRecordHandler, 在 ln: 63 增加如下代码: tempCellData.setDataFormatData(dataFormatData);
Date(2022,5,6)
FormulaRecordHandler
tempCellData.setDataFormatData(dataFormatData);
* 修复03版本无法读取到公式格式的bug [Issue #2444](#2444)
4340aca
该问题已经在3.1.0+版本里面解决,最新版本:
3.1.0
zhuangjiaju
No branches or pull requests
03格式excel,单元格为公式,并设置单元格格式为数值,2位小数。
触发Bug的代码
cellData.getDataFormatData() 为空。代码错误应该在 FormulaRecordHandler 没有将DataFormat设置给tempCellData
The text was updated successfully, but these errors were encountered: