Another option is to create a simple spreadsheet with a single cell that has
the correct % formatting, save it as an XML document, and examine how Excel
does it by finding the formatting info in the XML doc...
"Terry Anderson" <terrya@xxxxxxxxxxxx> wrote in message
I am creating an excel spread sheet using the Jakarta POI and am having
trouble getting a cell to format as percent. I set up the cell as
// Create a cell style for percents.
Percents = HSSFWorkbook_createCellStyle(book);
DataFmt = HSSFWorkbook_createDataFormat(book);
TempStr = new_String('0.00%');
PctFmt = HSSFDataFormat_getFormat(DataFmt: TempStr);
The problem is that when the program runs, I only get whole percents and
anything under one percent shows as 0.00%.
In other words instead of getting 17.62% I get 17.00% and instead of
0.94% I get 0.00%.
Does any body have any ideas as to what I am doing wrong?
Switchboard 1.251.867.5481 ext 212
Direct Line 1.251.809.2312