Skip to Main Content

Java Programming

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

scientific notation and Java

807591Mar 11 2008 — edited Mar 11 2008
Hi. I Have the following questions. Would appreciate any response.
I am using JDK 1.4.2
Reading an Excel file with POI from appache.
The spread sheet has mixed data, and text - no formulas, taht's taken care of
Because of the nature of the application environment, we don't know the datatype in a cell ahead of time, so If I spot a number I get a nueric type, if I spot a character stream - I get a string, etc. ... but at the end of the cycle, in the application domain I have everything as STRINGS.

Problem 1:
In Excel file I have a entry: A = 20385759367
In Java it comes as: A = 2.0385759367E10

Problem 2:
In Excel file I have a entry: A = 10
In Java it comes as: A=10.0


Is there some way, to get it reformated back to 20385759367, and to 10 without going through all kind of string patterning with substrings and recognizing "E" ect .... maybe there is a method in some class, that I don't know about ?
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Apr 8 2008
Added on Mar 11 2008
2 comments
164 views