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.

Wed Sep 04, 2019 8:51 am

I have a DataTable with strings that I import into a sheet. Then I have to find columns with currency values (123 234.12 XX) and set the format to Currency so that excel can perform arithmetics on the values of the resulting file. How do I do this?

Danpantani
 
Posts: 5
Joined: Wed Sep 04, 2019 8:42 am

Wed Sep 04, 2019 12:28 pm

Hi,

Thanks for your inquiry.
Please refer to the code below to set the format to Currency.

Code: Select all
          range.NumberFormat = "\"¥\"#,##0.00_);[Red]\\(\"¥\"#,##0.00\\)";


If the code couldn’t solve your issue, to help us investigate your issue accurately, please offer us your DataTable and the desired Excel.

Best wishes,
Amber
E-iceblue support team
User avatar

Amber.Gu
 
Posts: 525
Joined: Tue Jun 04, 2019 3:16 am

Mon Sep 16, 2019 9:56 am

Hi,

Greetings from E-iceblue.
Has you tried the code I offered you last time? Does it solve your issue?
Could you please give us some feedback at your convenience?

Best wishes,
Amber
E-iceblue support team
User avatar

Amber.Gu
 
Posts: 525
Joined: Tue Jun 04, 2019 3:16 am

Tue Oct 22, 2019 2:44 pm

Hello, I apologize for my late reply. Your suggestion was helpful and I solved the issue.

Danpantani
 
Posts: 5
Joined: Wed Sep 04, 2019 8:42 am

Wed Oct 23, 2019 1:00 am

Hi,

Thanks for your feedback.
Any question, welcome to contact us. Have a nice day.

Best wishes,
Amber
E-iceblue support team
User avatar

Amber.Gu
 
Posts: 525
Joined: Tue Jun 04, 2019 3:16 am

Return to Spire.XLS