I am using Java and Apache POI to format an Excel worksheet.
I want to format a cell as dollars.
Using the suggestion in Basic Excel currency format with Apache POI, what I get is that the cell is formatted as shekels (which happens to be the default currency of my machine)
How do I format the cell as dollars, even if the default currency of my machine is not dollars.
The code I am using is as follows
CellStyle dollarStyle=wb.createCellStyle();
dollarStyle.setDataFormat(7);
CellUtil.getCell(myRow, 1).setCellStyle(dollarStyle);
The number 7 comes from http://poi.apache.org/apidocs/org/apache/poi/ss/usermodel/BuiltinFormats.html