The createStyle
function in the openxlsx
package has an argument numFmt
, which allows you to create an excel format to be applied to specific cells in a .xlsx file. You can round values by specifying numFmt = '0'
, and you can apply a currency format by specifying numFmt = "CURRENCY"
.
Is there a way to specify a rounded currency format? I've tried the following:
- Rounding the values in the data frame doesn't work, because the excel
cells still display the cents e.g.
$103.00
. numfmt = 'CURRENCY0'
does not work
If not, is there another package which allows you to specify the formats of excel cells, and allows rounding of currency-formatted cells?
Edit:
This gives me what I wanted (Currency format, with commas, no cents)
createStyle(numFmt="$0,0")