Converting Excel cell to percentage using epplus

rach picture rach · Jun 24, 2013 · Viewed 15.4k times · Source

I would like to convert the value in to 2 decimal places. I am using EPPlus if the value is 66.6666667 and I would like to show it as 66.66% I tried the following code but its not working.

   foreach (var dc in dateColumns)
   {
       sheet.Cells[2, dc, rowCount + 1, dc].Style.Numberformat.Format = "###,##%";
   }

Please help.

Answer

rach picture rach · Jun 24, 2013

I found it!

I tried

 foreach (var dc in dateColumns)
  {
    sheet.Cells[2, dc, rowCount + 1, dc].Style.Numberformat.Format ="#0\\.00%";
   }