question

NormaW-0840 avatar image
0 Votes"
NormaW-0840 asked TimonYang-MSFT commented

How to convert column datatyp in excel to String using C#

Hello,

I have to convert the column datatype in Excel to String. The column contains scientific notation. Once I used NumberFormat to convert it, the scientific notation is not expanded. Can someone help? I need code. Thanks.
Oker

dotnet-csharp
· 1
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

@NormaW-0840
May I know whether your issue has been solved or not? If not, please share it in here. We can work together to figure it out.

0 Votes 0 ·

1 Answer

TimonYang-MSFT avatar image
0 Votes"
TimonYang-MSFT answered

Is there any difference between getting the scientific notation form and getting the ordinary number form?

We can easily convert them to each other with c#.

             decimal h = Decimal.Parse( cellValue.ToString(), NumberStyles.Any, CultureInfo.InvariantCulture);

Moreover, even if it is converted to Text type, its value still is the correct number. Is it different in your case?

86157-1.png


If the response is helpful, please click "Accept Answer" and upvote it.
Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.


1.png (22.6 KiB)
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.