EPPlus Format Cell as "Accounting" Number
EPPlus does not include the number formats built into Excel so you must set it manually.
All the built-in formats in Excel have an actual number format. For accounting, the format is:
-$* #,##0.00-;-$* #,##0.00_-;-$* "-"??-;-@-
The format above may differ depending on your region/settings. To see what the format is for any built-in formats:
Right-click a cell and select Format Cells
Click on your built-in format, in this case Accounting
- Click on Custom to see the format of the previously selected format
Apply the format to your cells:
ws.Cells["A1:A5"].Style.Numberformat.Format = "_-$* #,##0.00_-;-$* #,##0.00_-;_-$* \"-\"??_-;_-@_-";
I used this format is simulating same as "Accounting Number" in the Excel.
ws.Cells["A1:A5"].Style.Numberformat.Format = "_($* #,##0.00_);_($* (#,##0.00);_($* \"-\"??_);_(@_)"