-
-
Notifications
You must be signed in to change notification settings - Fork 323
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
Number, i18n and CSV download #992
Comments
Hello, CSV isn't normalized. RFC4180 is just a description of most common practices. When I export a document opened with french (france) locals containing Grist fails, casting it as I haven't tested MS excel by now. @yohanboniface can you tell us which tools you tested that can't consume this .csv file? IMO it's rather an import problem in grist than an export one. Two, non excluding, options look good to me :
Gristlabs people do you have an opinion on the wanted behavior in grist ? (@paulfitz @dsagal @anaisconce) Best regards |
I guess because your LibreOffice has a French locale too ?
https://github.com/mapbox/csv2geojson But for example parse it with python or any lib, you'll have a
I do not agree. Exporting a number in its localized representation means that each tool consuming it later should be smart enough to know how to parse that localized number. My two cents :) |
Yohan's arguments about the sanest behavior are persuasive to me. In general for this kind of situation, if there is some behavior common to Excel and Google Sheets, we would follow that as a de facto standard. Checking Google Sheets, I think I'm seeing behavior contrary to what Yohan would like? I make a spreadsheet, set it in French locale, add some numbers, export as CSV, check the CSV and see numbers like "10,3" rather than "10.3". It would be worth checking Excel too. If Excel and Google Sheets are exporting in localized form, that would be a strong vote against Grist doing differently. Adding configurable behavior here could be reasonable. |
Confirming that the current behavior is intended to match Excel/Google, and that Excel also exports what you see on the screen. If I change my preferred "Number format" system preference, and reopen a file in Excel, the export to CSV will look different:
Note also that this isn't just about decimal separators. The output match the full range of formatting options: currency symbols, percents, number of decimals, date formats, etc. So the best solution seems to be configurable behavior, like Paul suggested. Let me note also a related "mirror" wish on the API side, collected into this issue: #880. In short, API endpoints return raw data, but sometimes it's very handy to be able to get it formatted, the way it's visible in CSV (this matters particularly for dates and references). |
This PR adds two options: - parseLatLng (which default to `parseFloat`), allowing to take control on how the lat and lng text values will be parsed - sexagesimal (default=true), which allow to skip the sexagesimal parsing (when false), as it wrongly parses a French number ("1,234" will become 1) In uMap, we are sometimes in the need to parse CSV files where lat/lng values are in French number format (with "," as separator, instead of "."). For a bit more context: gristlabs/grist-core#992
This PR adds two options: - parseLatLng (which default to `parseFloat`), allowing to take control on how the lat and lng text values will be parsed - sexagesimal (default=true), which allow to skip the sexagesimal parsing (when false), as it wrongly parses a French number ("1,234" will become 1) In uMap, we are sometimes in the need to parse CSV files where lat/lng values are in French number format (with "," as separator, instead of "."). For a bit more context: gristlabs/grist-core#992
Hi there, me again! :)
It seems that when Grist is in French, the number columns are exported as text.
Here is an example document:
Untitled document(2).grist.txt
Column A is type Text, column B is type Number, column C is type Number with percent (but useless in this test).
Here is the downloaded CSV:
I'd expect all column to be treated as number in the CSV:
So any other tool that will consume this CSV could cast it correctly.
I may be missing something in my settings!
Thanks for your lights on this :)
And keep up the good work on Grist!
Cheers
The text was updated successfully, but these errors were encountered: