Home of POI and fire twirling Rainbow Russ - uploaded by Rouge DragonGrassy Gita - uploaded by Rouge DragonBunny and Dragon - uploaded by Rouge Dragon
      

Read Numeric value From Excel

      
Topic Options
Rate This Topic
#848503 - 23/10/07 08:16 PM Read Numeric value From Excel
Sreeram Offline
newbie

Registered: 23/10/07
Hi,

I was trying to read numeric value from an excel file.I used the function "cell.getNumericCellValue()" to read the column. Some times the value is fetched correctly and some times it returns a high precision value( ie, some times the value 118.474 is fetched as 118.4739999999), while I require the exact value.
The format type of the column in the excel is "custom".

Can any one please help me on this?

Sreeram

Top
#848504 - 29/10/07 09:45 PM Re: Read Numeric value From Excel [Re: Sreeram]
PK_ Offline
Lambretta Fanatic

Registered: 20/12/01
118.4739999999 ...considering excel uses better calculations than myself I'd say that figure was most likely to be correct when 118.474 may look logically correct.

I'm no mathematician nor excel user.

Good luck.
_________________________
PK.

"To be an angel, one need not have wings.
In giving love there is an equal grace.
Nor need one seek the aura in the face,
As love unveils the beauty of all things."

*Francois Couperin.

Top
#848505 - 29/10/07 10:22 PM Re: Read Numeric value From Excel [Re: PK_]
Deamon_Llama Offline
member

Registered: 14/10/07
Loc: Melbourne
I can show mathematically that 118.4739999999 is actually equal to 118.474, but I don't think that will be particularly useful, sorry
_________________________
--- No statements are true unless they can be proven scientifically. ---

Top
#848506 - 13/01/08 06:06 PM Re: Read Numeric value From Excel [Re: Deamon_Llama]
Yakumo Offline
veteran

Registered: 31/05/06
Loc: Oxfordshire
are you always reading cell.getNumericCellValue into a variable with a datatype that can hold the full value? and are all the fields your reading from definitely formatted correctly?

same problem is discussed here though you havn't actually said what language you're programming/scripting in...
_________________________
Blinded by Hyperlights, please donate generously grin

Top
#848507 - 14/01/08 10:34 AM Re: Read Numeric value From Excel [Re: Yakumo]
Mr_Chutney Offline
Tosser

Registered: 18/04/03
Loc: Herefordshire
Nor indeed why you are posting this on a poi forum?!

Top



     Show more..