Reputation: 25
I can either set thousand operator like this:
cell.getCellStyle().setDataFormat(HSSFDataFormat.getBuiltinFormat("#,#00"));
Or set two decimal places:
cell.getCellStyle().setDataFormat(HSSFDataFormat.getBuiltinFormat("0.00"));
Is there an option to set both?
Upvotes: 0
Views: 1051
Reputation: 25
This worked for me:
cell.getCellStyle().setDataFormat(HSSFDataFormat.getBuiltinFormat("#,##0.00"));
Found solution based on @Fullslack.dev comment https://poi.apache.org/apidocs/dev/org/apache/poi/ss/usermodel/BuiltinFormats.html
Upvotes: 1