try
        {
          double dvalue =
ble.valueOf(
                          doubleformattedstring ).doubleValue();
        }
        catch( NumberFormatException nfe )
        {
           ...
        }


    Clumsy and kind of stupid, but it works.  Haven't seen a better, one step way ( 
open to suggestions. )  BTW, this question is better suited to java/advanced java 
lists.  I won't be as nasty as dvae ( I would put sic, but assume he can spell his own 
name, ) but if you look at the API for Double, you'll see there is no parseDouble(), 
hence the not found.  This is what you call Object Oriented Consistency in the Java 
API and why A) most of us work with the online API docs at hand B) we get deprecated 
methods.  ;-0!


                                            Joe Sam

    -----Original Message-----
    From: Kirstin Battershill <[EMAIL PROTECTED]>
    To: [EMAIL PROTECTED] <[EMAIL PROTECTED]>
    Date: Tuesday, May 18, 1999 12:46 PM
    Subject: Re: another basic question


    But this is my problem,   but I don't want a DOUBLE OBJECT,
    I want a DOUBLE VALUE / TYPE.  I have tried the below method but then I have the 
problem of converting the Double d object to the value which the database will take 
without throwing an exception because it wants a double  whilst  I am giving it a  
Double  And it is this that is causing me the grieve.

    I tried the Double.parseDouble,  but I just get  :  not found in java.lang.Double

    Kirstin





    David Mossakowski wrote:

        Double d = Double.valueOf(stringRepresentationOfDouble);
        or
        Double d = new Double(stringRepresentationOfDouble);
        (remeber to catch NumberFormatException)

        dvae.

        P.S. Please refer to documentation (trying to be polite but RTFM :).

        Kirstin Battershill wrote:

        > Hi Guys,
        >
        > another basic question
        >
        > I am taking
 a set double value from doGet (0.5 to be precise)
        >
        > and want to pass it into a double variable in doPost and then pass
the
        > double value into a database field which is double as well.
        >
        > My problem is,  this is the first time I have used a double and I
have
        > no idea about the request.getParameter bit.
        >
        > with integers you  obviously use Integer.parseInt(STRING), but I
have
        > tried similar combinations using doubleValue and valueOf and also
        > tried declaring a new Double object and parsing that.
        >
        > But to no avail.
        >
        > Help
        >
        > Thanks
        >
        > Kirstin
        >
        >

        --
        David Mossakowski        [EMAIL PROTECTED]
        http://www.dwdog.com/styk      212.310.7275

        "I don't sit idly by, I'm planning a big surprise"
        F         U         G         A        Z        I


___________________________________________________________________________
        To unsubscribe, send email to [EMAIL PROTECTED] and include in
the body
        of the message "signoff SERVLET-INTEREST".

        Archives:
http://archives.java.sun.com/archives/servlet-interest.html
        Resources:
http://java.sun.com/products/servlet/external-resources.html
        LISTSERV Help: http://www.lsoft.com/manuals/user/user.html

___________________________________________________________________________
To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
of the message "signoff SERVLET-INTEREST".

Archives: http://archives.java.sun.com/archives/servlet-interest.html
Resources: http://java.sun.com/products/servlet/external-resources.html
LISTSERV Help: http://www.lsoft.com/manuals/user/user.html

Reply via email to