roo-rb / roo

Roo provides an interface to spreadsheets of several sorts.
MIT License
2.78k stars 502 forks source link

support formatting percentage excelx numbers of arbitrary precision #596

Open DubHunt opened 1 year ago

DubHunt commented 1 year ago

This fixes an issue where a percentage cell with a precision of 1 or 3+ digits after the decimal raises a RuntimeException.

Summary

This fixes a bug where an .xlsx file that had a cell formatted with a single digit precision, e.g., 4.2%, would raise an exception:

*** RuntimeError Exception: Unknown format: "0.0%"

It seems the only percentage formats that were supported were no digits after the decimal and two digits after the decimal. This fix should support any number of digits after the decimal.