accarvajal
asked on
Double parsing problems
Hi!
I have a String with a number data like "16777645" which I need to convert to double. So I used Double.parse(sData), but double parsed like 1.6777645E7. How can I do parsing with double returns 16777645
I have a String with a number data like "16777645" which I need to convert to double. So I used Double.parse(sData), but double parsed like 1.6777645E7. How can I do parsing with double returns 16777645
ASKER
no, if my data (in my case is an ID) 16777645, next to parsing, I convert into String again so 1.6777645E7 is different than 16777645
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
if my String Data "16777645" parsing to Double which results in 1.6777645E7, when converting to String again, data would be "1.6777645E7", how do I tell to user that "1.6777645E7" (showed on JTextField) is looking at field is actually "16777645" that is its ID?
You could do e.g.
field.setText("" + (long)yourDouble);
field.setText("" + (long)yourDouble);
just use
Double.parseDouble(String_ Variable)
or
double.parseDouble(String_ Variable)
both might be correct..
hope this will help
Double.parseDouble(String_
or
double.parseDouble(String_
both might be correct..
hope this will help
Closer control over how the String is rendered can be achieved with NumberFormat
Why would that be a problem? That's just the form shown when you print it as as String