roo-rb / roo

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

Add support for "1e6" as scientific notation #433

Closed amichal closed 6 years ago

amichal commented 6 years ago

We discovered a xlsx file in the wild recently using cell data with the format <c r="A1" s="1"><v>1e6</v></c> to mean 1000000. I've not been able to determine what generated this xml or if it is valid according to the spec but this PR adds support for this format to the existing code which handles scientific notation.

The oldest version of Excel i have handy (Excel for Mac 2011, v 14.7.3) would have generated <c r="A1" s="1"><v>1E+06</v></c> in this case.

A new unit test is added as well.

coveralls commented 6 years ago

Coverage Status

Coverage increased (+1.5%) to 94.174% when pulling 43f7ef5414e730eb392383e2ed8e4e5fb3aecc55 on greenriver:fix_simple_sci_notation into 3ed05e1caef0ce3c5db5c19f1fa14e6f74193079 on roo-rb:master.

tgturner commented 6 years ago

@amichal Can you provide a sample spreadsheet?

chopraanmol1 commented 6 years ago

@tgturner since it is really small change and does not have any side effect, I think we should go ahead with this one.

amichal commented 6 years ago

@tgturner @chopraanmol1 Thanks -- sorry i missed providing a sample.