A friendly place for programming greenhorns!
Big Moose Saloon
Register / Login
Java in General
how to convert double number into an exponential format
Joined: Feb 07, 2006
Jun 22, 2006 06:54:00
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
Author and all-around good cowpoke
Joined: Mar 22, 2000
Jun 22, 2006 07:41:00
have you tried Double.toString( val ) ?
Joined: Oct 13, 2005
Jun 22, 2006 08:07:00
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
class in the API for details.
If you are using older versions you would have to use
classes, which are much more awkward to use.
rocket mass heater
subject: how to convert double number into an exponential format
double value formatting ...
Is it possible to reformat the output from a double value?
Actual parameter checking
All times are in JavaRanch time: GMT-6 in summer, GMT-7 in winter
| Powered by
Copyright © 1998-2013