BlackBerry Forums Support Community
              

Closed Thread
 
LinkBack Thread Tools
Old 07-20-2010, 08:07 AM   #1 (permalink)
New Member
 
Join Date: Jul 2010
Model: 9550
PIN: N/A
Carrier: airtel
Posts: 7
Post Thanks: 0
Thanked 0 Times in 0 Posts
Default convert exponent value to double

Please Login to Remove!

hey,

i want to convert a exponent value like 1.0E-4 value to double.can anyone help me with this
__________________
Nivy
Offline  
Old 07-20-2010, 08:25 AM   #2 (permalink)
BlackBerry Extraordinaire
 
Join Date: Mar 2008
Location: Austin, TX
Model: 9700
PIN: N/A
Carrier: T-Mobile
Posts: 1,644
Post Thanks: 0
Thanked 34 Times in 33 Posts
Default

Did you already try

double d = Double.parseDouble("1.0E-4");

According to the javadocs, this works.
Offline  
Old 07-20-2010, 08:50 AM   #3 (permalink)
New Member
 
Join Date: Jul 2010
Model: 9550
PIN: N/A
Carrier: airtel
Posts: 7
Post Thanks: 0
Thanked 0 Times in 0 Posts
Default

nope no luck
its displaying the same value
__________________
Nivy
Offline  
Old 07-20-2010, 10:02 AM   #4 (permalink)
BlackBerry Extraordinaire
 
Join Date: Jan 2006
Model: LEZ10
OS: 10.0.10
Carrier: Rogers CA
Posts: 1,704
Post Thanks: 20
Thanked 77 Times in 68 Posts
Default

Code:
        double d = Double.parseDouble("1.0E-4");
        System.out.println(d);
Output: 1.0E-4

So yes, it does work. If you want it to display in some other format (like 0.0001) you will have to get into output formating.
__________________
My other Blackberry is a PlayBook.
Offline  
Old 07-22-2010, 10:36 AM   #5 (permalink)
New Member
 
Join Date: Jul 2010
Model: 9550
PIN: N/A
Carrier: airtel
Posts: 7
Post Thanks: 0
Thanked 0 Times in 0 Posts
Default convert exponential value to double

__________________
Nivy
Offline  
Closed Thread


Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

INDRAMAT AC SERVO CONTROLLER No. TDM 3.2-030-300-W1 & MOD13/1X0091-070
$795.0
INDRAMAT AC SERVO CONTROLLER No. TDM 3.2-030-300-W1 & MOD13/1X0091-070 picturefarmall 300 and 350 torque amplifier handle
$10.0
farmall 300 and 350 torque amplifier handle pictureFanuc A06B-6124-H104 /B A06B6124H104 servo amplifier 565-679V, 2.8KW, 9.1A
$1090.0
Fanuc A06B-6124-H104 /B A06B6124H104 servo amplifier 565-679V, 2.8KW, 9.1A pictureTamagawa Seki AU6550N2062 / AU6539 / AU6550N2041 and Sony PL82-7T03 / PL82-7T04
$1950.0
Tamagawa Seki AU6550N2062 / AU6539 / AU6550N2041 and Sony PL82-7T03 / PL82-7T04 pictureNew MFG Refurbished Fanuc A06B-6114-H304 D A06B6114H304 aiSV 20/20/40 3-AXIS SE
$1880.0
New MFG Refurbished Fanuc A06B-6114-H304 D A06B6114H304 aiSV 20/20/40 3-AXIS SE picture






Copyright 2004-2016 BlackBerryForums.com.
The names RIM and BlackBerry are registered Trademarks of BlackBerry Inc.