Aspose could not preserve the precision of exponentail value

Last post 01-27-2011, 4:27 AM by Amjad Sahi. 1 replies.
Sort Posts: Previous Next
  •  01-26-2011, 9:42 PM 281267

    Aspose could not preserve the precision of exponentail value

    Hi Team,

    I got a big problem,I got an CSV file from my customer who has an exponential value 5.7893E+49. When i try to retrive that value from the file using CSV i am getting 5789300000000000000.... instead of 578934512398572359120345728437.

    Is this a known issue or a default behaviour. Can you please explain me detaily on this. Its really a show stopper to us.

    Thanks,

    Pravin.

     

    Filed under: aspose.cells bug
     
  •  01-27-2011, 4:27 AM 281344 in reply to 281267

    Re: Aspose could not preserve the precision of exponentail value

    Hi,

    Well, I think this is due the limitation of MS Excel related to CSV format. You can simply open your csv file into Ms Excel and then right- click to get Format Cells.. dialog box to, now convert to Numbers and you will get the same value retrieved by Aspose.Cells.

    For you case if you need to get the exact scientific value you may try:
    string filename = @"e:\test2\mbook.csv";
                Workbook wb = new Workbook(filename, new LoadOptions(LoadFormat.CSV));

                Worksheet ws = wb.Worksheets[0];
            
                   
                    MessageBox.Show(ws.Cells["A1"].Value.ToString());  //5.7893E+49

    Thank you. 
              


    Amjad Sahi
    Support Developer,
    Aspose Sialkot Team
    Contact Us
     
View as RSS news feed in XML