Reputation: 162
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
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