You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@poi.apache.org by "rodrigo.garcia@kotasoft.com" <ro...@kotasoft.com> on 2009/01/27 20:10:12 UTC

Percent format

Hi all,

I'm using 3.2 version and I'm doing that:

cell.setCellValue(Double.parseDouble(sharePercent)/100); (this set a 
value like this 00,00)

but I don't know how to fix the percent format I want.

I've tried with style.setDataFormat((short)0xa); but it sets the coma 
one digit to the left, for example 1,667% instead of 16,67%
I also have tried with style.setDataFormat(format.getFormat(”00,00%”)); 
and others

Any idea?

Thanks and regards





---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@poi.apache.org
For additional commands, e-mail: user-help@poi.apache.org


Re: Percent format

Posted by Pierre Lavignotte <pi...@gmail.com>.
Hi,

You should try to set the format you want in Excel and then read it with POI
to see how it looks like.

Pierre

Cordialement,
Pierre Lavignotte
Ingénieur Conception & Développement
http://pierre.lavignotte.googlepages.com


On Tue, Jan 27, 2009 at 8:10 PM, rodrigo.garcia@kotasoft.com <
rodrigo.garcia@kotasoft.com> wrote:

> Hi all,
>
> I'm using 3.2 version and I'm doing that:
>
> cell.setCellValue(Double.parseDouble(sharePercent)/100); (this set a value
> like this 00,00)
>
> but I don't know how to fix the percent format I want.
>
> I've tried with style.setDataFormat((short)0xa); but it sets the coma one
> digit to the left, for example 1,667% instead of 16,67%
> I also have tried with style.setDataFormat(format.getFormat("00,00%")); and
> others
>
> Any idea?
>
> Thanks and regards
>
>
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@poi.apache.org
> For additional commands, e-mail: user-help@poi.apache.org
>
>