-
-
Notifications
You must be signed in to change notification settings - Fork 593
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
ODS exports numbers as text? #527
Comments
I would appreciate if you could test my pull request. |
Thanks Matthijs Kooijman for the report.
Thanks Matthijs Kooijman for the report. Co-authored-by: Hugo van Kemenade <hugovk@users.noreply.github.com>
@claudep Would you please also add support for excel? xlsx and xls export_type also exports numbers as text: |
Are you sure? I believe I switched from ODS to XLSX because that can export numbers. Looking at my code, I am explicitly passing |
There is already a test that export and reimport various data as xlsx and ensure that data format is kept: Line 1046 in bbc2739
|
I've been trying to export data with numbers in them, and found I could not do calculations with them in the resulting ODS spreadsheet (the values are left-aligned instead of right aligned, and have a ' in front of them).
Here's my testcase:
Opening the resulting ODS in libreoffice shows:
Note the leading
'
in the field value. I suspect that this leading'
is not written by tablib itself, but tablib writes out table cells as text. Here's a snippet fromcontent.xml
in the generated ODS:The above screenshot is with the libreoffice locale set to "English (USA)". I originallly had it set to "Dutch (Netherlands)", which uses
,
as the decimal separator, so I suspected it was a decimal separator problem, but switching to a local with.
as the decimal separator did not help.Exporting in the xlsx format does give a proper numerical value that can be used in calculations (with both locales), so I'll be using that as a workaround for now.
The text was updated successfully, but these errors were encountered: