locked
excel is turning my strings into gibberish floats! RRS feed

  • Question

  • User-1930897342 posted

    Hello,

    I'm not to sure if this is the right forum for this but i have a bit of code that exports data in a datagrid into excel but i noticed that it messes up a particular field when exporting. eg ..

    i have the value of something like 89234010000725515875 in a column in the datagrid but when exported, it turns it into  89234+19.

    Is there any excel formatting that will bring back my original number?

    thanks

    Sunday, March 14, 2010 4:54 PM

All replies

  • User-158764254 posted

    you could prefix the data with a single quote

        '89234010000725515875

    or you could use a library like NPOI to take more control over the resulting xls

        http://npoi.codeplex.com/ 

    Sunday, March 14, 2010 10:04 PM