This project has moved. For the latest updates, please go here.

Handle decimal cell that can be be empty

Mar 11, 2013 at 3:51 PM
Edited Mar 12, 2013 at 8:30 AM
I have a big document I am trying to read, one row is decimal values, but sometimes these are not set

I want these to just be set to 0 in my code, but no matter what I try to convert it gives issues

Either I cast the cell to decimal which gives me an exception every time a field is not set (This is very often, so tons of exception slowing down the application)

Or I cast to string and then convert that to decimal after I check wether its null or empty, but decimal cant handle when I try to convert the string 7,64031013406825E-10 to decimal

So is there a way to handle empty cells in a smart way in ClosedXML ?

Edit: Solved it with row.Cell(startColumn).IsEmpty()