Asked • 03/18/19

How can I set contents of a spreadsheet cell to Accounting format with EPPlus?

I need to set the contents of certain columns to Accounting format. This attempt: public static readonly string NUMBER_FORMAT_ACCOUNTING = "$"; . . . bidPriceCell.Style.Numberformat.Format = NUMBER_FORMAT_ACCOUNTING; ...simply gives "$" and "-$" as the values. This attempt: public static readonly string NUMBER_FORMAT_ACCOUNTING = "$0.00"; . . . bidPriceCell.Style.Numberformat.Format = NUMBER_FORMAT_ACCOUNTING; ...gives me values such as, "$24.09" and "-$0.91" What the user wants is space between the dollar sign and the value, and parens around negative values, such as "$ 24.09" and "$ (0.91)" What string do I need to assign the Numberformat.Format property for this to work?

1 Expert Answer

By:

John B. answered • 12/09/20

Tutor
5.0 (807)

Daily Excel user since 1997, daily Google sheets user since 2015

Still looking for help? Get the right answer, fast.

Ask a question for free

Get a free answer to a quick problem.
Most questions answered within 4 hours.

OR

Find an Online Tutor Now

Choose an expert and meet online. No packages or subscriptions, pay only for the time you need.