randym / axlsx

xlsx generation with charts, images, automated column width, customizable styles and full schema validation. Axlsx excels at helping you generate beautiful Office Open XML Spreadsheet documents without having to understand the entire ECMA specification. Check out the README for some examples of how easy it is. Best of all, you can validate your xlsx file before serialization so you know for sure that anything generated is going to load on your client's machine.
MIT License
2.62k stars 696 forks source link

Format with nil values #596

Open jamiebrs opened 6 years ago

jamiebrs commented 6 years ago

I have three items I'd like to be able to format, both floats, integers and percentages so that if there are nil rows excel doesnt treat the whole column as a string.

If I use the number formatting it makes the nil's 0 or 0.0 or 0.0% (I;m using format code so I can have a 0.0% instead of 0.00 adding the percent on as I didnt see a number code for one decimal place)

I'd like for it to not change nils to those values and instead just leave it as nil but the problem I'm running into when I do that is the sorting excel does makes the columns into strings so everything is sorted A-Z instead of smallest to largest.

jamiebrs commented 6 years ago

I ended up figuring this out youre supposed to use :types =>