Search code examples
epplusepplus-4

epplus for generating excel using greater than and less than


I am using epplus for Excel. how can use greater than and less than condition for showing debit and credit value with dr and cr.

  • if value is -123456 I want to show it like this: ₹1,23,456 DR
  • if value is 123456 I want to show it like this:₹1,23,456 CR

I'm using Style.Numberformat.Format = "₹ #,###.00" but it's showing results this way: -₹1,23,456. How can I make it to append cr and dr?


Solution

  • Do something like this:

    Style.Numberformat.Format = "₹ #,###.00 \"CR\";₹ #,###.00 \"DR\""