On Thu, 2009-10-15 at 13:55 -0500, Terry Anderson wrote:
The field is set up as follows:
D PCT_OF_TOTAL S 6 2 INZ(0)
The field is calculated as follows:
PCT_OF_TOTAL = (LBPOUNDS / DIVISION_TOTAL);
It is a while since I worked with Excel, but this behaviour sounds
reasonable to me. Taking the numbers from your previous message,
eval PCT_OF_TOTAL = .1762; // That's 17.62%
dsply %editc( PCT_OF_TOTAL: 'L' ); // .17
Try defining PCT_OF_TOTAL with four decimal places.
It is placed on the sheet as follows:
hssf_num ( row: 3 : PCT_OF_TOTAL : Percents);
Are you saying that I should use a data type other than decimal?
Switchboard 1.251.867.5481 ext 212
Direct Line 1.251.809.2312
date: Thu, 15 Oct 2009 12:40:22 -0400
from: "Dennis Lovelady" <iseries@xxxxxxxxxxxx>
subject: RE: Formatting a Cell as a Percent using POI.
pctCell = HSSFWorkbook_createCellStyle(book);
TempStr = new_String('0.00%');
NumFmt = HSSFDataFormat_getFormat(DataFmt: TempStr);
Since your code is so similar to this, I would look at the code that's
placing the cell value. What data type is used? INT would be a problem,
as would numeric with zero decimals.
If voting changed anything, they'd make it illegal.