| Author |
how to convert double number into an exponential format
|
prashant gour
Ranch Hand
Joined: Feb 07, 2006
Posts: 45
|
|
i have double value like .000000000004 and i want into format as 4.0E-11, will u help me out on this issue Thanks in advance Prashant
|
 |
William Brogden
Author and all-around good cowpoke
Rancher
Joined: Mar 22, 2000
Posts: 12325
|
|
have you tried Double.toString( val ) ? Bill
|
 |
Campbell Ritchie
Sheriff
Joined: Oct 13, 2005
Posts: 32833
|
|
Are you using J2SE5.0? If there is a 5 in your version (or a 6), you want to use the formatting options. Look up the java.util.Formatter class in the API for details. If you are using older versions you would have to use NumberFormat and DecimalFormat classes, which are much more awkward to use. CR
|
 |
 |
|
|
subject: how to convert double number into an exponential format
|
|
|