Sreeram
newbie
Member #61533
Reged: 23/10/07
847386
|
Read Numeric value From Excel find similar
23/10/07 08:16 PM
|
|
|
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
Post Extras:
Notify moderator!
|
|
|
PK_
50 deluxe

Member #1107
Reged: 20/12/01
Loc: Lost In Pele.
848528
|
29/10/07 09:45 PM
|
|
|
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.
Post Extras:
Notify moderator!
|
|
|
Deamon_Llama
member

Member #61087
Reged: 14/10/07
Loc: Melbourne
848542
|
29/10/07 10:22 PM
|
|
|
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.
---
Post Extras:
Notify moderator!
|
|
|
Yakumo
Hyperlight zealot

Member #35166
Reged: 31/05/06
Loc: Oxfordshire
858446
|
13/01/08 06:06 PM
|
|
|
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
Post Extras:
Notify moderator!
|
|
|
Mr_Chutney
Tosser

Member #4487
Reged: 18/04/03
Loc: Herefordshire
858513
|
14/01/08 10:34 AM
|
|
|
Nor indeed why you are posting this on a poi forum?!
-------------------- There is no book that can tell you what happened after you're dead except one written by a dead person and dead people don't write. All you have to do is go and and look at a lot of dead people, they're not writing, they just aren't.
Stephen Fry
Post Extras:
Notify moderator!
|
|
|