I am working on a software application that needs to export data in CSV format. However, I’ve encountered a couple of issues:
Timestamps: When exported, the timestamp fields don’t display in the desired format.
Long IDs: Long numeric IDs are displayed in scientific notation, which makes them hard to read.
To address this, I added \t (tab) after each field during export. This forces the timestamps and IDs to display correctly as text in the CSV file.
However, this also converts numeric fields (like integers and floats) to strings, which prevents operations like calculating averages or sums directly in the CSV.
Is there a better way to export data so that:
Timestamps and long IDs display correctly in their original formats.
Numeric fields remain numeric and usable for calculations?
Any advice or examples would be greatly appreciated. Thank you!