There is a cell in my Excel file containing this number: 5892101102012990
and other cells containing mixed data (also strings)
I get this cell's data like this :
var filestream = File.Open(@"D:\111XLS\File.xlsx", FileMode.Open, FileAccess.Read, FileShare.ReadWrite);
var reader = ExcelReaderFactory.CreateReader(filestream);
while (reader.Read())
{
var intt = int.Parse(textBox1.Text);
var v1 = reader.GetValue(intt);
var v2 = reader.GetValue(intt + 3);
listBox1.Items.Add(v1 ?? "");
listBox2.Items.Add(v2 ?? "");
}
When it gets to that cell in return I have this : 5.89210110201299E+15
If I change the cell format in Excel file to Special
(Excel assumes it's a Zip-code) it will return exact number but editing the Excel file is out of options.
I'm aware that I can get the data using reader.GetDouble(intt);
but because of mixed content this will cause more trouble.
Any advice on some sort of option to tell ExcelDataReader
to not converting 5892101102012990
to this 5.89210110201299E+15
?