Closed cschloer closed 4 years ago
Hi,
There is a bug in the tabulator XLSX parser for the preserve_formatting flag.
Specifically, when cells of type percentage are loaded they are always returned as 0.
The solution is to add
# Return percentage formatted cells as is if excel_number.endswith('%'): return value
To the beginning of the convert_excel_number_format_string function (here https://github.com/frictionlessdata/tabulator-py/blob/master/tabulator/parsers/xlsx.py#L334). This will then return 0.5 for a percentage of 50%.
convert_excel_number_format_string
0.5
50%
Let me know if you're too busy and I should create a fork myself, just figured it was easier for you since you are more frequently pushing to this repo :)
Please preserve this line to notify @roll (lead of this repository)
Will update this issue to show 50% instead of 0.5
I created a PR since that was the easiest way to show.
FIXED in #332
Overview
Hi,
There is a bug in the tabulator XLSX parser for the preserve_formatting flag.
Specifically, when cells of type percentage are loaded they are always returned as 0.
The solution is to add
To the beginning of the
convert_excel_number_format_string
function (here https://github.com/frictionlessdata/tabulator-py/blob/master/tabulator/parsers/xlsx.py#L334). This will then return0.5
for a percentage of50%
.Let me know if you're too busy and I should create a fork myself, just figured it was easier for you since you are more frequently pushing to this repo :)
Please preserve this line to notify @roll (lead of this repository)