Hi All, I'm creating xlsx workbook using XSSF and having issues assigning the currency format to a cell. My problem happens if the number is greater than 10,000.00. I get ######## instead of the number. If I click on that cell, I get the correct number, but I don't want to explain that to my clients :) If the number is less than 10k everything works perfectly.
I have an Excel template which I'm populating with values from the CSV file. In that template all I have is a row with column headers. I'm setting a currency format to one of the columns in the template and then reading that format in my program. I then assign that format to each cell in that column. I've tried using Excel's default currency format : $#,##0.00 and I've tried changing it to allow greater numbers: $###,##0.00. But with both of them I get the same problem if the number is greater than 10k. Here's the code that I'm using to set the format: XSSFCellStyle style = wb.createCellStyle(); CreationHelper createHelper = wb.getCreationHelper(); String dFormat = sheet.getRow(1).getCell(col).getCellStyle().getDataFormatString(); style.setDataFormat(createHelper.createDataFormat().getFormat(dFormat)); cell.setCellValue(Double.parseDouble(value)); cell.setCellStyle(style); I would greatly appreciate any help with this. Sincerely, Konstantin. -- View this message in context: http://old.nabble.com/Problems-setting-currency-format-tp28517432p28517432.html Sent from the POI - User mailing list archive at Nabble.com. --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
