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. Image for the cookie policy date
close icon

Setting Percentage NumberFormat in formula cell

How do you set the NumberFormat of a cell to percentage when the cell contains a formula?

I tried the following but it the cell style is not changed:

worksheet.Range["A1"].Number = 10.92;
worksheet.Range["B1"].Number = 20.67;
worksheet.Range["C1"].Formula = "A1/B1";
worksheet.Range["C1"].NumberFormat = "0.00%";

C1 displays "0.5283018", but it should display "52.83%".

1 Reply

MW Melba Winshia Syncfusion Team October 26, 2007 08:47 AM UTC

Hi Kjell,

I am afraid that I was not able to reproduce the issue. I tested the issue with your code snippets under below system configuration:

Microsoft Windows XP
Professional
Version 2002
Service Pack 2

OS language - English
Regional Options - English(United States)
Essential Studio version - 5.2.0.25

Here is the video clip your reference:

http://www.syncfusion.com/Support/user/uploads/TestVedio_f3905bfc.zip

Please take a look at the above video clip and let me know if I am missing something and also let me know if there are any configuration changes, so that I can test in that environment and sort out the cause of the issue and provide you a solution.

Thanks,
Melba

Loader.
Live Chat Icon For mobile
Up arrow icon