Spire.XLS is a professional Excel API that enables developers to create, manage, manipulate, convert and print Excel worksheets. Get free and professional technical support for Spire.XLS for .NET, Java, Android, C++, Python.

Mon Dec 18, 2023 3:38 pm

I'm trying to use Spire.XLS to read very high precision decimals out of Excel. I'm loosing precision in all attempts (including DisplayedValue).

My example is
Put this value into Excel: 0.0003410362464207640

When you read it from Spire, you get 0.0003410362460000000 whether you use NumberText, NumberValue, Value, Value2, or DisplayedText.

Is there any way to do this using Spire?

Thanks,

Sam

spire_sphillips
 
Posts: 10
Joined: Tue Feb 01, 2022 10:59 pm

Tue Dec 19, 2023 5:42 am

Hi,

Thank you for your inquiry.
I tested the number you provided through the latest commercial version of Spire.Xls 13.12, but I didn’t encounter the same problem as you. Please download the latest commercial version of Spire.xls13.12 for retesting through the link:https://www.e-iceblue.com/Download/download-excel-for-net-now.html
I put the complete code below for your reference:
Code: Select all
// Create a new Workbook object
Workbook workbook = new Workbook();

// Load the workbook from the specified file path
workbook.LoadFromFile(@"..\test1.xlsx");

// Get the first worksheet in the workbook
Worksheet worksheet = workbook.Worksheets[0];

// Get the range of the specified cell
CellRange cell = worksheet.Range["A1"];

// Output the value of the cell
Console.WriteLine("The value of the cell is: " + cell.Value);


Sincerely,
Ula
E-iceblue support team
User avatar

Ula.wang
 
Posts: 282
Joined: Mon Aug 07, 2023 1:38 am

Tue Dec 19, 2023 9:59 pm

You are correct! I had a 12.xx version. The upgrade seems to have done the trick. Thank you!

spire_sphillips
 
Posts: 10
Joined: Tue Feb 01, 2022 10:59 pm

Wed Dec 20, 2023 1:36 am

Hi,

Thank you for your feedback.
If you have any question, just feel free to write back. I hope you have a wonderful day.

Sincerely,
Ula
E-iceblue support team
User avatar

Ula.wang
 
Posts: 282
Joined: Mon Aug 07, 2023 1:38 am

Return to Spire.XLS