You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@poi.apache.org by Rutger van Iperen <ru...@amis.nl> on 2011/07/08 10:56:26 UTC

Retrieve percentage data from Cell

Hello,

I am trying to read excell sheets, but when I run into percentages, I allways get the value 1.0.

Right now I simply take the cell and call  cell.getNumericValue()

Is there anything I can do to retrieve the proper value, so if its 85% I would like 0.85 returned.

Thanks,

Rutger

RE: Retrieve percentage data from Cell

Posted by Rutger van Iperen <ru...@amis.nl>.
Nick, you are right, I just found that I was reading something else than I thought I was reading. Sorry to bother everyone with this, thanks for the response though.

rutger

________________________________________
From: Nick Burch [nick.burch@alfresco.com]
Sent: Friday, July 08, 2011 1:07 PM
To: POI Users List
Subject: Re: Retrieve percentage data from Cell

On Fri, 8 Jul 2011, Rutger van Iperen wrote:
> I am trying to read excell sheets, but when I run into percentages, I
> allways get the value 1.0.
>
> Right now I simply take the cell and call  cell.getNumericValue()

I'd double check you're reading the cell you think you are. If a cell is
formatted as a percentage, and showing 85% in Excel, then it'll be stored
as 0.85 in the file

Nick

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


Re: Retrieve percentage data from Cell

Posted by Nick Burch <ni...@alfresco.com>.
On Fri, 8 Jul 2011, Rutger van Iperen wrote:
> I am trying to read excell sheets, but when I run into percentages, I 
> allways get the value 1.0.
>
> Right now I simply take the cell and call  cell.getNumericValue()

I'd double check you're reading the cell you think you are. If a cell is 
formatted as a percentage, and showing 85% in Excel, then it'll be stored 
as 0.85 in the file

Nick

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