Sorry, didn't mean to be nasty. See below for more suggestions.
Joe Sam Shirah wrote:
> 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)
>
<snip>
Once you have the Double object you can get
double dd = d.doubleValue()
or in one step:
double d = (new Double(stringRepresentationOfDouble)).doubleValue();
(I tried it and it compiles)
dave.
(look ma' I can spell)
--
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