I have a long string that I want to save to CSV. I use the following code to convert the string to blob and save as a file:
Attachment newFile = new Attachment(); newFile.Name = getReportFileName(); newFile.Body = Blob.valueOf(csvContent);
However, when I open the csv, I see some numbers are formatted like 1.00E+01 instead of 10. I thought this is an Excel issue and opened the raw file in another editor (Notepad++) and still see the same format, which makes me think it is an issue with the generated file and not Excel. Obviously, I could not find anything related in the Blob Class documentation and when I debug the values in the code before saving to file, the numbers are shown correctly. The problematic values are calculated with this code
What can be causing this issue?