Denis
Denis

Reputation: 162

C# Excel number format as Brazilian currency

I'm trying to format a column of a data sheet to Brazilian currency format like so:

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

But it's formating like this: "RR$ 3500,00".

The value is 3500 and I want like this: R$ 3.500,00

Thanks

Upvotes: 0

Views: 1678

Answers (1)

H. de Jonge
H. de Jonge

Reputation: 890

Shouldn't you use "$ #,##0.00"?

The "." indicates the decimal separator and "," is thousands separator. Excel should replace them with the actual separators from the regional settings. Also "$" is the currency which would be set to R$ in your case. That's why you're getting a double R.

See Custom Number Format Strings for more information.

Upvotes: 2

Related Questions