I realize this is an old thread but thought I'd post a solution that I'm
using since I found it hard to find.
HSSFWorkbook wb = ...
HSSFDataFormat df = wb.createDataFormat();
short dataFormat = df.getFormat("0.0000"); //can also use a format like
"0.00##" if you don't want extra decimal places to display when they don't
exist
HSSFCellStyle style = wb.createCellStyle();
style.setDataFormat(dataFormat);
Sanjiv
On Thu, Jun 5, 2008 at 3:19 PM, Siva Kumar <[email protected]> wrote:
> I want to set the number of decimal places in the generated excel. How to
> set the number of decimal places through poi 3.0.1?
>
> Thanks in advance
>
> Siva
>