pure scala question from newbie

this actually isn't IJ question, just super basic scala.

Very simple thing: how to access the string to number methods to convert a string to a double.  I think either the scala Double or the java.lang.Double , either one would be fine. But I can't get them.



        val distString =                node \\ "distance" text     // this correctly gets a string
        val distance   =  new Double distString  // compiler error:
        val distance   =  Double parseDouble distString  // compiler error:


so how does one do this??

4 comments
Comment actions Permalink

Try "123.45".toDouble

or for your example distString.toDouble

For further Scala questions, that are not related to the plugin, I recommend you use http://www.stackoverflow.com

0
Comment actions Permalink

Additional useful resources for those with questions or difficulties with Scala include:



Randall Schulz

0
Comment actions Permalink

Thanks for the reply.  Realizing this were not the perfect place to ask the question, but I was a refugee here after being unable to post on scala-lang.org (technical difficulties on that site) even after having registered.

0
Comment actions Permalink

Thanks Randall for that comprehensive list of resources.

0

Please sign in to leave a comment.