Hi Abhinav,
in this area I encountered similar problems. Due to other circumstances I
can't switch to the solution to proceed each numeric value with a ', so I
ended up in this work-a-round:
[..]
final int cellType = cell.getCellType();
if (cellType == HSSFCell.CELL_TYPE_NUMERIC)
{
mydouble = new Double(cell.getNumericCellValue());
}
else if (cellType == HSSFCell.CELL_TYPE_STRING)
{
myString = cell.getStringCellValue();
mydouble = parseStringVal(myString);
}
[..]
May be this solution is worth to consider for your problem.
Greetings from Cologne, Germany,
cu Stefan
Stefan Marx
Marx Consulting (extern)
REWE GROUP
Geschäftsbereich Konzern-Systeme
Funktionsbereich Business-Systeme
REWE-Informations-Systeme GmbH
Humboldtstraße 140-144 - 51149 Köln
Telefon: +49 (0)221 149 - 5953
Telefax: +49 (0)221 149 - 97 5953
E-Mail: [EMAIL PROTECTED]
www.rewe-group.com
> -----Ursprüngliche Nachricht-----
> Von: Abhinav Srivastava [SMTP:[EMAIL PROTECTED]
> Gesendet am: Mittwoch, 12. Juli 2006 02:28
> An: [email protected]
> Betreff: numeric cell type
>
> While reading a XLS using HSSF, cells which contain numbers
> are being returned as type NUMERIC. e.g a cell having 2 would have its
> value returned as 2.0 (double) and not as "2" as I would like it to.
> any help?
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
Mailing List: http://jakarta.apache.org/site/mail2.html#poi
The Apache Jakarta Poi Project: http://jakarta.apache.org/poi/