Cells of Excel spreadsheet are read using Microsoft.Office.Interop.Excel object. I need to find out formatting for number values and apply accordingly. For instance I have 19.0000 value but when it is read Value2 will be "19" however I need to keep it "19.0000"
Excel.Range sheetRange = xlWorksheet.Range["A1", lastCell];
var cell = sheetRange.Cells[row, col];
cell.Value2 == "19";
There is a NumberFormat property that returns formatting string like "0.0000" that I could use, but I can't find out how to check if cell value is a number.