poi-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From illyus...@dev.kck.ru
Subject getStyle()getDataFormat && NumberFormatter Question
Date Fri, 23 Jan 2004 14:31:14 GMT
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 
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.
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message