Reputation: 2849
I am trying to add different numbers from a file in java.
Numbers can be of format : "1.13206e+06"
How can I parse this number to reflect actual value in java??
Thanks
Upvotes: 2
Views: 233
Reputation: 1502196
You can use Double.parseDouble
:
double d = Double.parseDouble("1.13206e+06");
This works fine with scientific notation.
Upvotes: 5