while reading number greater than 12 digits from excel using c#,number get converted to zero

后端 未结 1 556
情书的邮戳
情书的邮戳 2021-01-24 00:30

i\'m trying to read a number with length greater than 12 digits from excel file using c# using below query

 \"select Format([F1], \'Number\') as Code\";
<         


        
相关标签:
1条回答
  • 2021-01-24 01:12

    According to MSDN:

    Excel follows the IEEE 754 specification on how to store and calculate floating-point numbers. Excel therefore stores only 15 significant digits in a number, and changes digits after the fifteenth place to zeroes.

    To work around this behavior, format the cell as text. The cell can then display up to 1,024 characters.

    http://support.microsoft.com/kb/269370

    0 讨论(0)
提交回复
热议问题