turicas / rows

A common, beautiful interface to tabular data, no matter the format
GNU Lesser General Public License v3.0
865 stars 136 forks source link

Fix percent formatting reading on XLSX and ODS file formats #291

Closed jsbueno closed 6 years ago

jsbueno commented 6 years ago

This fixes issue #290 -

The first fix is about avoid crashing rows if a page marked with number_format->percent in a spreadsheet contains any text value.

The second fix mostly comprises on deleting the strange dance around Decimal <-> str conversion and simply using native Python's str format with the option to format numbers as percentages, which will use 2 decimal places by default. The original code would break if the actual value had no decimal places (like "100%") .

turicas commented 6 years ago

Thank you! Merged. :D