Quote:
My question is, how do i get the formatted (displayed) value from the cell?
Well, it would appear you have some formatting being applied at a global/sheet level, or a column level, or individual cells - you seem to indicate this because of the
Quote:
with format '00000'
but Im unsure how the 'Standard' format is set up
Approach 1 would therefore be to be able to read and decode the format information from the spreadsheet and apply the same format to your C# string cellContent, whether that's a 'local' or a 'Standard' format setting/ This discussion *may* ymmv help you in this respect
c# - How to know the formatting of Excel Cell - Stack Overflow[
^]
Approach 2 would be "I cant get/interpret the formatting data from Excel", so I'll handle it locally in C#
Both approaches end the same way, in that (in the case you have shown) it's a
cellContent.PadLeft(5, '0')
It is often the case in software that a value - number, or date, is stored in way/value, but what we see is a 'formatting' directive being applied - dates are a classic, they are so rarely stored as a character set of (eg) "2020/07/04", as opposed to being stored in a numerical form which makes them easier to compare and calculate against