At a glance, that data format should work - but, I do not think you need the
brackets. Try this;

cs.setDataFormat(HSSFDataFormat.getBuiltinFormat("$#,##0.00;-$#,##0.00"));

I have tested that format sting using Excel and it does display the trailing
zero.

One thing I did notice though from the code you posted was this;

row.createCell(13);
Cell mycell2 = row.getCell(13);
mycell2.setCellStyle(cs);
mycell2.setCellValue(dDebtAmt); 

Now, really, the code should read like this;

Cell mycell2 = row.createCell(13);
mycell2.setCellStyle(cs);
mycell2.setCellValue(dDebtAmt); 

The create method will return a new cell object to you. This might - and
that is might - be the source of the problem. The get methods are usually
used if you are editing an existing worksheet and the cells do already
exist.

Yours

Mark B

--
View this message in context: 
http://apache-poi.1045710.n5.nabble.com/dataformat-tp4266621p4267106.html
Sent from the POI - User mailing list archive at Nabble.com.

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to