Hi all,
I am facing a problem with the format of a calculated fields in a datatable.
When writing these results into .csv, the format is automatically switched to Scientific mode and I get 4E-05 instead of my goal format: 0.00004.
Anyway to solve this issue, (without some string parsing method)?
Thank you all,
Best Regards.
P.S: I have already tried to convert the fields ToDecimal and ToDouble and then to String but got the same issue.
For viewing: I have tried both (excel and text editor) but still got same issue,
I have noticed that writing the output table into .xlsx files does respect the format I am looking for “0.00004”.
I want to understand why is this issue happening when writing the datable into .csv files with Write CSV activity.
Is the datatype of your column a double?
When writing to CSV it takes whatever datatype provided and outputs it in the same format.
Example Datatable using different datatypes
Double,String
1E-05,0.00001
This is exactly what is seen in the csv.
XLSX files uses excel formatting to retain generic (text) formatting which is why it doesnt happen.
I had a similar problem. I fixed it using string type and adding “variable” = “variable.toString(“F6”)”.
If I only use the string type, I still have 1E-05 when I write the .csv file.
I have noticed the same as mentioned in your comment, I was actually adding datacolumns to my DT that would be calculated fields, I chose System.Double as TypeArgument, but this doesn’t suit the format I would like to have in my output .csv file.
Solution: switching to String type column, the output .csv format (ex: 0.00004) is maintained.