C# excel format column

Asked

Viewed 1,504 times

0

I am trying to format an excel column for currency format.

excelWorksheet.Range["S1", "S" + linhas].NumberFormat = "R$ #.###,00"

But this causes it to format this way "RR$ 3500,00".

In the cell is 3500 and I would like to stay: R $ 3,500,00 that doing in hand would be changing the die to currency and the symbol to R$.

Thank you.

  • Are you using Epplus?

  • No. Just visual studio and excel.

  • By excel you mean Interop?

  • Yes! Worksheet, Workbook...

1 answer

1


Just put the $, because it takes the language from the file to generate the currency symbol.

excelWorksheet.Range["S1", "S" + linhas].NumberFormat = "$ #.###,00"
  • Adding, I left so: "$ #.##0,00", because when it was 0 he was formatting like this: ,00.

Browser other questions tagged

You are not signed in. Login or sign up in order to post.