POI itself doesnt have any code to do stuff like this, we give you the number and the format, to do what you please with it :)
You will probably have to convert the format you get from excel to something that JDK's NumberFormat classes accept, and use that. Documentation of the NumberFormat class is at Sun's site: http://java.sun.com/j2se/1.4.2/docs/api/java/text/NumberFormat.html On Fri, 2004-01-23 at 20:01, [EMAIL PROTECTED] wrote: > Hello all. > I'm new in POI, so sorry for maybe a silly question. > I'm using HSSF API to read xls files and to construct my objects. > But I don't know how to manage cell formatting which is used in Excell. > For example: > I have a cell value in Excel - "95%" this is a numeric field with > "percent formatting". > When I apply cell.getNumericCellValue() I receive 0.95. I guess it's OK. > Then I use cell.getCellStyle().getDataFormat() and receive "0%" which is > also OK. > But I didn't find how to receive a result(in String format, maybe) with > value "95%". > Is there any way in POI to construct such a string having value(0.95) and > dataType(0%)??? > I've found 2 NumberFormatter classes, but I don't know how to use them, > the is absolutely no documentation > and while tryng NumberFormatter,format(99,1) I receive an error : 99 index > out of bounds. > > Thanks in advance. --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
