Quantcast
Channel: Excel Data Reader - Read Excel files in .NET
Viewing all articles
Browse latest Browse all 448

New Post: ExcelOpenXmlReader: numbers stored as text

$
0
0
Hi,

I come to an issue that when using the ExcelOpenXmlReader, the numbers formated as text in Excel are always converted to double, ex: the number 0006181(text) is converted to 6181.0(double).
In line 279 there is a verification to see if the format is text:
else if (xf.NumFmtId == 49)
  o = o.ToString();
but the convertion is from the object already converted to double!

Sugestion:
else if (xf.NumFmtId == 49)
   o = _xmlReader.Value;
this will preserve numbers as text, as long as they are formated as text in Excel.

Viewing all articles
Browse latest Browse all 448

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>