I'm using Gembox spreadsheet to export some data to .CSV but aren't getting any decimals in the output file.
When exporting as XLSX everything looks as expected.
I've tried both Gembox 3.7 and 3.9 but the result is the same.
Use the following code to reproduce the issue.
SpreadsheetInfo.SetLicense("FREE-LIMITED-KEY");
var ef = new ExcelFile();
var ws = ef.Worksheets.Add("NumberFormatTest");
ws.Cells[0, 0].Value = "Expected";
ws.Cells[1, 0].Value = "0";
ws.Cells[2, 0].Value = "0.0";
ws.Cells[3, 0].Value = "0.00";
ws.Cells[0, 1].Value = "Actual";
ws.Cells[1, 1].Value = 0m;
ws.Cells[1, 1].Style.NumberFormat = "0";
ws.Cells[2, 1].Value = 0m;
ws.Cells[2, 1].Style.NumberFormat = "0.0";
ws.Cells[3, 1].Value = 0m;
ws.Cells[3, 1].Style.NumberFormat = "0.00";
ef.Save("Numberformat test.csv");
ef.Save("Numberformat test.xlsx");
How can I get the correct result without resorting to .ToString("0.00")
?