I am using Aspose for processing an excel in my application. However some of the cells contain decimal values which excel is converting to exponential. I need to read the original decimal values while processing and not the exponential form. How can it be done using Aspose? I cannot manually modify the excel here as it comes from an external source.
You can use Cells[index].Value property to read the original value present in the cell. Please see the sample code which will help you getting your desired result.
Sample Code:
Workbook workbook = new Workbook(); workbook.Open("C:\\output1.xls"); Cells cell = workbook.Worksheets[0].Cells; // get decimal value from a decimal type cell Cells cell = workbook.Worksheets[0].Cells; for (int i = 1; i < 8; i++) { if (CellValueType.IsNumeric == cell[i, 1].Type) { decimal originalValue = (decimal)cell[i, 1].Value;
// add the code to use the decimal value from the cell } }
Sets consent for sending user data to Google for online advertising purposes.
Sets consent for personalized advertising.
Cookie Notice
To provide you with the best experience, we use cookies for personalization, analytics, and ads. By using our site, you agree to our cookie policy.
More info
Enables storage, such as cookies, related to analytics.
Enables storage, such as cookies, related to advertising.
Sets consent for sending user data to Google for online advertising purposes.
Sets consent for personalized advertising.
Cookie Notice
To provide you with the best experience, we use cookies for personalization, analytics, and ads. By using our site, you agree to our cookie policy.
More info
Enables storage, such as cookies, related to analytics.
Enables storage, such as cookies, related to advertising.
Sets consent for sending user data to Google for online advertising purposes.