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

White LCD Display+Touch Screen Digitizer Assembly Replacement for iPhone 5S OEM
$13.99
White LCD Display+Touch Screen Digitizer Assembly Replacement for iPhone 5S OEM pictureLot of 3 Wiped Seagate 750GB 7200 RPM 3.5" ST3750640NS OEM Apple Hard Drives
$89.99
Lot of 3 Wiped Seagate 750GB 7200 RPM 3.5Seagate 750GB 7200 RPM 3.5" ST3750640NS OEM Apple Hard Drive Wiped
$35.99
Seagate 750GB 7200 RPM 3.5CC8: Genuine OEM Apple Mac LONG DVI to VGA Video Adapter Cable 603-2120/591-011
$9.34
CC8:  Genuine OEM Apple Mac LONG DVI to VGA Video Adapter Cable 603-2120/591-011 pictureOEM Part HARD Drive assembly 250mb SCSI Oerlikon 901-416 APPLE iTRADE-AG with c
$137.5
OEM Part HARD Drive  assembly 250mb SCSI Oerlikon 901-416 APPLE iTRADE-AG with c picture






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