issue with parsing to String value that is Double or BigInteger
Closed this issue · 6 comments
Hi! @ozlerhakan
I use poiji and faced with the following issue:
can't parse to java String
but xlsx file has the following values
Can you help me understand what I am doing incorrectly?
Thank you for contributing to Poiji! Feel free to create a PR If you want to contribute directly :)
Hi @dashayakubovich ,
Hmm interesting... could you share your excel file with me, if you don't mind?
example.xlsx
@ozlerhakan hi, sure
Apparently, in your excel file, you have predefined special formats for numbers in your cells. The problematic format number that your excel is using by default is 165. We need to remove that format from the style table using the following approach in Poiji:
PoijiNumberFormat numberFormat = new PoijiNumberFormat();
numberFormat.putNumberFormat((short) 165, "");
PoijiOptions poijiOptions = PoijiOptions.PoijiOptionsBuilder.settings()
.poijiNumberFormat(numberFormat)
# rest of your options
# ...
.build();
I hope it helps your problem. You can check how to modify number formats in your excels at https://github.com/ozlerhakan/poiji?tab=readme-ov-file#modify-cells-formats
@ozlerhakan
I do it in this way, but no success
You can check what format number each cell is using with https://github.com/ozlerhakan/poiji?tab=readme-ov-file#debug-cells-formats and once you have the number, you can update it accordingly.