We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy.
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

String.Format(CultureInfo.GetCultureInfo("de-DE").NumberFormat, "{0:0.00}", someValue) does not format

Thread ID:

Created:

Updated:

Platform:

Replies:

127938 Dec 20,2016 01:06 PM UTC Dec 21,2016 11:52 AM UTC ASP.NET MVC 1
loading
Tags: XlsIO
Peter
Asked On December 20, 2016 01:06 PM UTC

I am trying to format outside of Syncfusion a String for a Cell in an EXCEL-file.
But the result in c# is not the same as in Excel, I need need a pricision of 2 digit without any currency sign.

This works:

String.Format(CultureInfo.GetCultureInfo("de-DE"), "{0:C}", someValue)

But that is not what I am looking for.

I need 2 digits and no sign, that is what I tried:

 String.Format(CultureInfo.GetCultureInfo("de-DE").NumberFormat, "{0:0.00}", someValue)

How to do this ?

Abirami Varadharajan [Syncfusion]
Replied On December 21, 2016 11:52 AM UTC

Hi Peter, 
Thank you for contacting Syncfusion support. 
As you are assigning value to the cell by appending two digits along with decimal, it gets ignored as per MS Excel behavior. 
So, we request you to apply Number format to the cell to achieve your requirement. Kindly refer below code snippet to achieve the same. 
Code Example: 
worksheet.Range["A10"].Value = "10000"; 
worksheet.Range["A10"].NumberFormat = "0.00"; 
 
Please let us know if you have any concerns. 
Regards, 
Abirami 


CONFIRMATION

This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

Warning Icon You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.Close Icon

;