poi-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Amol Deshmukh <adeshm...@hobsons-us.com>
Subject RE: Help with HSSF set NUMERIC Cell Value
Date Mon, 19 Sep 2005 12:24:17 GMT
2 ways you can resolve this issue:
1. If you need only 2 decimal precision, round to 2 decimals
in Java and set the value.
2. If you need the full precision, but want to display 
only the first 2 decimals, set the value as you are doing now
and use the HSSFDataFormat class to set the cell's display
format to show only 2 decimal places.

Regards,
~ amol


> -----Original Message-----
> From: Daniele Renda [mailto:dany1981@tiscali.it]
> Sent: Sunday, September 18, 2005 3:28 PM
> To: poi-user@jakarta.apache.org
> Subject: Help with HSSF set NUMERIC Cell Value
> 
> 
> Hello, I have a problem when I try to write a .xls file in 
> with there is
> a cell with a numeric value. Infact, I use a BigDecimal object in my
> application with scale(2), that rappresent the number in the format
> 99.99, with 2 decimal. But when I write the cell I have to write the
> cell with double value because HSSF don't support any format.
> So in my .xls file I have the cell with a value that don't have 2
> decimal.For exemple, if I want to write 150.00, HSSF write 
> 150 on .xls file.
> 
> Anyone can help me?
> Thanks
> 
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: poi-user-unsubscribe@jakarta.apache.org
> Mailing List:     http://jakarta.apache.org/site/mail2.html#poi
> The Apache Jakarta Poi Project:  http://jakarta.apache.org/poi/
> 

---------------------------------------------------------------------
To unsubscribe, e-mail: poi-user-unsubscribe@jakarta.apache.org
Mailing List:     http://jakarta.apache.org/site/mail2.html#poi
The Apache Jakarta Poi Project:  http://jakarta.apache.org/poi/


Mime
View raw message