Quantcast
Channel: ClosedXML - The easy way to OpenXML
Viewing all articles
Browse latest Browse all 1877

New Post: How do I get formatted cell values, according to the excel cell format definitions?

$
0
0
Hello,
I have problems reading formatted cell values from an existing excel file.

In my excel sheet I have cells formatted for numbers with "Decimal places: 1".
In a certain cell the visible value is "0,1". When I read the cell value I receive "0.10000000000000009".
I checked the Style property (of XLCell) and found several format settings (e.g. for Border or Font) I could also find in the excel file. But taking a look at Style.NumberFormat.Format I only see "0.0".
I need to get the formatted values from the excel file because I must create a xml file containing exactly the original "visible" cell values! I also need to get the same decimal marker. In my case a comma instead of the point!
Is there any way to achieve this? I also tried with GetFormattedString but there was no difference.

Regards,
Christian

Viewing all articles
Browse latest Browse all 1877

Trending Articles