Don't convert exponents?

21 views
Skip to first unread message

andy...@gmail.com

unread,
Jan 30, 2016, 5:47:41 PM1/30/16
to axlsx
I have some values I'm trying to output in the form of "12E540865" and axlsx is taking these as powers of 10! When Excel opens the workbook, it is saying it needs repair.

I even tried:

...
ws.add_row field.to_s
...

And it still gets converted in the XML to "infinity" in a Value field:

...
<c r="K2" s="0" t="n"><v>Infinity</v></c>
...

This is what is causing Excel to say the file needs repair, I think. It repairs fine, but then of course this value is not there.

The only thing I have found to work is adding more string data to the cell:

ws.add_row "#{field} "

What else can I do to stop this conversion?

andy...@gmail.com

unread,
Jan 30, 2016, 6:02:57 PM1/30/16
to axlsx
I found this and it did work. Not sure if there's a more efficient way than setting the type of every cell by row:
https://github.com/randym/axlsx/issues/117
Reply all
Reply to author
Forward
0 new messages