BlackBerry Forums Support Community
              

Closed Thread
 
Thread Tools
Old 07-20-2010, 08:07 AM   #1
nibedita
New Member
 
Join Date: Jul 2010
Model: 9550
PIN: N/A
Carrier: airtel
Posts: 7
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
Dougsg38p
BlackBerry Extraordinaire
 
Join Date: Mar 2008
Location: Austin, TX
Model: 9700
PIN: N/A
Carrier: T-Mobile
Posts: 1,644
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
nibedita
New Member
 
Join Date: Jul 2010
Model: 9550
PIN: N/A
Carrier: airtel
Posts: 7
Default

nope no luck
its displaying the same value
__________________
Nivy
Offline  
Old 07-20-2010, 10:02 AM   #4
hrbuckley
BlackBerry Extraordinaire
 
Join Date: Jan 2006
Model: LEZ10
OS: 10.0.10
Carrier: Rogers CA
Posts: 1,704
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
nibedita
New Member
 
Join Date: Jul 2010
Model: 9550
PIN: N/A
Carrier: airtel
Posts: 7
Default convert exponential value to double

__________________
Nivy
Offline  
Closed Thread



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

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


Jelenko Commodore LS VPF with Pump  picture

Jelenko Commodore LS VPF with Pump

$875.00



Vintage Commodore 64/28 Computer Model C2N Cassette Datassette With Box picture

Vintage Commodore 64/28 Computer Model C2N Cassette Datassette With Box

$34.99



Seikosha SP-1000VC Dot Matrix Printer for Commodore Computers - EUC picture

Seikosha SP-1000VC Dot Matrix Printer for Commodore Computers - EUC

$75.00



Vintage MOS 8502 8502R0 Commodore C64 very rare good condition x 1pc picture

Vintage MOS 8502 8502R0 Commodore C64 very rare good condition x 1pc

$22.00



Vintage Printer Switch box Commodore 64/Sanyo Mountable Computer PC picture

Vintage Printer Switch box Commodore 64/Sanyo Mountable Computer PC

$49.00



Windsor Commodore Duo 20

Windsor Commodore Duo 20" Carpet extractor w/Lester Charger 25900/Battery/99hour

$2799.99







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