poi-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Marx, Stefan ext. MA Fa. Lynx" <Stefan.Marxext.MAFa.L...@rewe-group.com>
Subject AW: numeric cell type
Date Wed, 12 Jul 2006 07:30:33 GMT
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: Stefan.Marxext.MAFa.Lynx@rewe-group.com
www.rewe-group.com


> -----Ursprüngliche Nachricht-----
> Von:	Abhinav Srivastava [SMTP:wri2me@gmail.com]
> Gesendet am:	Mittwoch, 12. Juli 2006 02:28
> An:	poi-user@jakarta.apache.org
> 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: poi-user-unsubscribe@jakarta.apache.org
Mailing List:     http://jakarta.apache.org/site/mail2.html#poi
The Apache Jakarta Poi Project:  http://jakarta.apache.org/poi/


Mime
View raw message