You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@poi.apache.org by Victor LaLoggia <Vi...@IntraSphere.com> on 2003/01/22 17:05:42 UTC

Displaying an Integer in a Spread Sheet

Hello Folks!

 

                I am having some difficulty with POI I am hoping someone
may help me with.

 

                I am trying to display an integer in a spread sheet.
However, whatever I do the integer ends up looking like this : 

                $123,456. 

                when displayed in Excel. Here is the offending code :

 

 

  ...           

   else
if(datatypeStr.equalsIgnoreCase(RoyaltyManagementConstants.DATATYPE_INTE
GER)) {

        theCell.setCellType(HSSFCell.CELL_TYPE_NUMERIC);

        cs = theCell.getCellStyle();

        cs.setDataFormat(m_dataFormatter.getFormat("#,###"));

        theCell.setCellStyle(cs);

        theCell.setCellValue(Integer.parseInt(valueStr));

      }

 

  

                I am using Jakarta-poi-1.9.0-dev-20021024.

 

                What am I missing?

 

                Thank you for your time!

 

                vic