Closed emiellohr closed 12 years ago
I'll take a look and try to reproduce this weekend, please keep me updated
I'm using Ruby 1.9. And for spreadsheet 1.0, Ruby 1.9 support is announced...
== Roadmap
0.7.0:: Improved Format support/Styles 0.7.1:: Document Modification: Formats/Styles 0.8.0:: Formula Support 0.8.1:: Document Modification: Formulas 0.9.0:: Write-Support: BIFF5 1.0.0:: Ruby 1.9 Support; Remove backward compatibility code
Could that be the problem? Any ideas?
I don't think that's the problem, as I'm using 1.9 as well Does OpenOffice show the same results as Microsoft Office?
Just an idea, try replacing 'int' with "int" (double quotes instead of single quotes)
Yes, Excel & OpenOffice are both the same.
The quote trick didn't make any difference. :-(
I just played with the classes but it doesn't seem to matter. All numeric values are prefixed with the quote.
I've just tried, and I cannot reproduce the problem. Could it be your regional settings?
I rewrote the haml to plain erb/html and now all goes fine, exept for rounded float values, such as 10.0, 7.0, ... They are still converted to text with leading quote. Maybe we need formatting here??
fmt = Spreadsheet::Format.new(:number_format => '0.00')
sheet1.row(1).set_format(1,fmt)
So rewriting HAML helped? Could you please post the original HAML here
No, it had nothing to do with the Haml.... You parse the generated html using nokogiri and based on the class you add an extra typecast. For fixnum values this works. For floats (no conversion) this also works, except for round float values, such as "7.0", or "10.0". These are interpeted as text (and prefixed with single quote). You should be able to reproduce this.
I see. However in your example typed ints and dates were getting the ' (td class='int') -- still can't reproduce that
No, me neither. I can't recall on what changed.
OK. Version 0.9.3 with float format support is now out!
Okay, thanks!
Hi glemb,
I'm using your gem which is handy, thanks! I've got one issue... all my numbers are preceded with a single quote.
My versions are: to_spreadsheet (0.9) spreadsheet (0.6.5.9)
The generated html is:
In the cells I find the text fields are okay, but the date and number fields are: '31,95 and '04-03-2012
Any clue?