Table export to CSV - issue with output

Hi all,

I’ve tried to search in the forum but I couldn’t find the same topic, so here’s my question.
I’m showing some values from a SQL server in a table.
So far all good, all the data in SQL are right and the output of the table too.
When I try to export the data to CSV, using system.dataset.exportCSV, the output is wrong with the float values.
I.e. I have a value of 5.2 (both SQL and table) and it’s shown 5.19999980926513 on the CSV file.
Now, I’m not sure this is a dataset issue or a CSV visualization issue, but could you help me understanding how to get the right data?
It’s probably a very simple thing, but I’m a bit lost :smiley:

thank you

How is the data type of the column in the SQL table configured? It sounds like you are getting the IEEE-754 representation of the floating point value when you are exporting to CSV.

Placing your value of 5.2 into this tool shows the same representation value that you are seeing on the CSV file, so I am assuming you have the SQL column configured as a float. If that can not be changed to a more precise data type, then you will need to do some conversions on the data before sending it to CSV.

3 Likes

Hi,

I think that’s the issue, thank you very much.
My columns in SQL are configured as a Float, hence the conversion problem.
I believe I’ll modify the columns then.
Thank you for your help!

Cheers

Valerio