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


Measurement Computing 197728B USB 1608HS-2A0 16-Channel Digital DAQ +2 Analog picture

Measurement Computing 197728B USB 1608HS-2A0 16-Channel Digital DAQ +2 Analog

$422.50



Schneider PLC TWIDO TM2AMM6HT ANALOGUE I/O MODULE 20mA 24VDC Missing Terminal picture

Schneider PLC TWIDO TM2AMM6HT ANALOGUE I/O MODULE 20mA 24VDC Missing Terminal

$156.00



HealthKit 4802 Computer Oscilloscope Heath Computer Systems picture

HealthKit 4802 Computer Oscilloscope Heath Computer Systems

$120.00



HealthKit 4802 Computer Oscilloscope Heath Computer Systems picture

HealthKit 4802 Computer Oscilloscope Heath Computer Systems

$149.99



Measurement Computing 4-20mA Input 24-Channel Analog Input Board CIO-DAS48-I picture

Measurement Computing 4-20mA Input 24-Channel Analog Input Board CIO-DAS48-I

$899.99



Columbus Instruments BP-2 Veterinary Automatic Blood Pressure Monitor picture

Columbus Instruments BP-2 Veterinary Automatic Blood Pressure Monitor

$199.94







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