title: POI Java - Numeric Cell with Decimals
body: <p>I'm having a lot of problems with numeric formats in a Cell with POI.</p>
  
  <p>I need to print in the cell 11 decimals for a number and also that the cell has a numeric format to make the sum when you select the data</p>
  
  <p>And I have this code:</p>
  
  <pre><code>private void writeDecimal(HSSFRow row, Double data, int position) {
      String pattern = "#.0000000000";
      HSSFCell celda = row.createCell(position);
      CellStyle styleDecimal = styles.get(ITEM_DECIMAL); // Font and alignment
      styleDecimal.setDataFormat(libro.getCreationHelper().createDataFormat().getFormat(pattern));
      celda.setCellStyle(styleDecimal);
      celda.setCellType(Cell.CELL_TYPE_NUMERIC);
      celda.setCellValue(data);
  }
  </code></pre>
  
  <p>But the result always print less decimal because Excel rounds the number:</p>
  
  <p><a href="https://i.stack.imgur.com/5aSTt.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/5aSTt.png" alt="Decimal Problem with POI"></a></p>
  
  <p>If I convert the <code>Double</code> to <code>String</code>, prints the 11 decimals but it doesn't make the sum if I select all the numbers.</p>
  
  <p>Any idea how to resolve this?</p>
  
  <p>Thanks</p>