title: Apache POI Java 6 to 8 Difference
body: <p>I'm using the HSSFWorkbook in apache poi 3.12 with Java 1.6 to turn .xls files into tab delimited text files.  In my processRecord method I get values from number fields using a FormatTrackingHSSFListener on a NumberRecord, numrec, in the following code:</p>
  
  <p><code>String value = formatListener.getFormatString(numrec);</code></p>
  
  <p>This takes a value, like 21.9, and rounds it to the nearest whole number.  My issue is that when I changed to a new server that is running Java 1.8, the value is truncated instead of rounded, so 21.9 becomes 21 instead of 22.  I've gone through apache's poi documents and they don't mention a change in behavior, so I'm asking for answers to the following questions: </p>
  
  <ul>
  <li>Why does this happen? (least important)</li>
  <li>Is there a way to retrieve the value so it rounds instead of truncates in Java 1.8?</li>
  <li>Is there a way to retrieve the value in its original form with no rounding or truncating?</li>
  </ul>
  
  <p>I've already tried another way of getting the value from the xls file:</p>
  
  <p><code>String value = new DataFormatter().formatCellValue(cell);</code></p>
  
  <p>but I get the same behavior.</p>